
<!DOCTYPE HTML>
<html lang="zh-hans" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>三、使用 Spring Boot · Spring Boot 中文文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="lichongbing.com">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search-plus/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-prism/prism-twilight.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="using-spring-boot.html" />
    
    
    <link rel="prev" href="getting-started.html" />
    

    <style>
    @media only screen and (max-width: 640px) {
        .book-header .hidden-mobile {
            display: none;
        }
    }
    </style>
    <script>
        window["gitbook-plugin-github-buttons"] = {"repo":"lichongbing/springboot","types":["star","watch"],"size":"small"};
    </script>

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="输入并搜索" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    Introduction
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#boot-documentation">
            
                    
                    一、Spring Boot 文档
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#boot-documentation-about">
            
                    
                    1、关于本文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#boot-documentation-getting-help">
            
                    
                    2、获取帮助
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#boot-documentation-first-steps">
            
                    
                    3、起步
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#_working_with_spring_boot">
            
                    
                    4、使用 Spring Boot
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#_learning_about_spring_boot_features">
            
                    
                    5、了解 Spring Boot 的新特性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.6" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#_moving_to_production">
            
                    
                    6、生产环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.7" data-path="boot-documentation.html">
            
                <a href="boot-documentation.html#_advanced_topics">
            
                    
                    7、高级内容
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="getting-started.html">
            
                <a href="getting-started.html">
            
                    
                    二、入门
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-introducing-spring-boot">
            
                    
                    8、Spring Boot 简介
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-system-requirements">
            
                    
                    9、系统要求
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.2.1" data-path="getting-started.html">
            
                <a href="getting-started.html#_servlet_containers">
            
                    
                    9.1、Servlet 容器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-installing-spring-boot">
            
                    
                    10、安装 Spring Boot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-installation-instructions-for-java">
            
                    
                    10.1、针对 Java 开发人员的安装说明
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.1.1" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-maven-installation">
            
                    
                    10.1.1、Maven 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.1.2" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-gradle-installation">
            
                    
                    10.1.2、Gradle 安装
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3.2" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-installing-the-cli">
            
                    
                    10.2、安装 Spring Boot CLI
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.3.2.1" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-manual-cli-installation">
            
                    
                    10.2.1、手动安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2.2" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-sdkman-cli-installation">
            
                    
                    10.2.2、使用 SDKMAN! 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2.3" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-homebrew-cli-installation">
            
                    
                    10.2.3、使用 OSX Homebrew 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2.4" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-macports-cli-installation">
            
                    
                    10.2.4、使用 MacPorts 安装
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2.5" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-cli-command-line-completion">
            
                    
                    10.2.5、命令行完成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3.2.6" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-cli-example">
            
                    
                    10.2.6、快速入门 Spring CLI 示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.3.3" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-upgrading-from-an-earlier-version">
            
                    
                    10.3、升级旧版 Spring Boot
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application">
            
                    
                    11、开发第一个 Spring Boot 应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.4.1" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-pom">
            
                    
                    11.1、 创建 POM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.2" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-dependencies">
            
                    
                    11.2、 添加 Classpath 依赖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.3" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-code">
            
                    
                    11.3、 编码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.4.3.1" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-annotations">
            
                    
                    11.3.1、@RestController 与 @RequestMapping 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.3.2" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-auto-configuration">
            
                    
                    11.3.2、@EnableAutoConfiguration 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.3.3" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-main-method">
            
                    
                    11.3.3、main 方法
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.4.4" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-run">
            
                    
                    11.4、运行示例
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4.5" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-first-application-executable-jar">
            
                    
                    11.5、创建可执行 jar
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="getting-started.html">
            
                <a href="getting-started.html#getting-started-whats-next">
            
                    
                    12、下一步
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter active" data-level="1.5" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html">
            
                    
                    三、使用 Spring Boot
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-build-systems">
            
                    
                    13、构建系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-dependency-management">
            
                    
                    13.1、依赖管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-maven">
            
                    
                    13.2、Maven
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.2.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-maven-parent-pom">
            
                    
                    13.2.1、继承 Starter Parent
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1.2.1.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-maven-without-a-parent">
            
                    
                    13.2.2、不使用父 POM
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.2.1.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-maven-plugin">
            
                    
                    13.2.3、使用 Spring Boot Maven 插件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.1.3" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-gradle">
            
                    
                    13.3、Gradle
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.4" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-ant">
            
                    
                    13.4、Ant
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.1.5" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-starter">
            
                    
                    13.5、Starter
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-structuring-your-code">
            
                    
                    14、组织代码
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.2.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-using-the-default-package">
            
                    
                    14.1、使用 default 包
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-locating-the-main-class">
            
                    
                    14.2、定位主应用类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-configuration-classes">
            
                    
                    15、配置类
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.3.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-importing-configuration">
            
                    
                    15.1、导入额外的配置类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-importing-xml-configuration">
            
                    
                    15.2、导入 XML 配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.4" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-auto-configuration">
            
                    
                    16、自动配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.4.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-replacing-auto-configuration">
            
                    
                    16.1、平滑替换自动配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.4.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-disabling-specific-auto-configuration">
            
                    
                    16.2、禁用指定的自动配置类
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.5" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-spring-beans-and-dependency-injection">
            
                    
                    17、Spring Bean 与依赖注入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.6" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-using-springbootapplication-annotation">
            
                    
                    18、使用 @SpringBootApplication 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-running-your-application">
            
                    
                    19、运行您的应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.7.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-running-your-application">
            
                    
                    19.1、使用 IDE 运行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-running-as-a-packaged-application">
            
                    
                    19.2、作为打包应用运行
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7.3" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-running-with-the-maven-plugin">
            
                    
                    19.3、使用 Maven 插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7.4" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-running-with-the-gradle-plugin">
            
                    
                    19.4、使用 Gradle 插件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.7.5" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-hot-swapping">
            
                    
                    19.5、热交换
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.8" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools">
            
                    
                    20、开发者工具
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.8.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-property-defaults">
            
                    
                    20.1、Property 默认值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-restart">
            
                    
                    20.2、自动重启
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.8.2.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-restart-logging-condition-delta">
            
                    
                    20.2.1、条件评估变更日志
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-restart-exclude">
            
                    
                    20.2.2、排除资源
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2.3" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-restart-additional-paths">
            
                    
                    20.2.3、监视附加路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2.4" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-restart-disable">
            
                    
                    20.2.4、禁用重启
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2.5" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-restart-triggerfile">
            
                    
                    20.2.5、使用触发文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2.6" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-customizing-classload">
            
                    
                    20.2.6、自定义重启类加载器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.2.7" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-known-restart-limitations">
            
                    
                    20.2.7、已知限制
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.8.3" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-livereload">
            
                    
                    20.3、LiveReload
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.4" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-globalsettings">
            
                    
                    20.4、全局设置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.5" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-remote">
            
                    
                    20.5、远程应用
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.8.5.1" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#_running_the_remote_client_application">
            
                    
                    20.5.1、运行远程客户端应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.8.5.2" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-devtools-remote-update">
            
                    
                    20.5.2、远程更新
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5.9" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-packaging-for-production">
            
                    
                    21、打包生产应用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.10" data-path="using-spring-boot.html">
            
                <a href="using-spring-boot.html#using-boot-whats-next">
            
                    
                    22、下一步
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features">
            
                    
                    四、Spring Boot 特性
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-application">
            
                    
                    23、SpringApplication
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-startup-failure">
            
                    
                    23.1、启动失败
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-banner">
            
                    
                    23.2、自定义 banner
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-customizing-spring-application">
            
                    
                    23.3、自定义 SpringApplication
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-customizing-spring-application">
            
                    
                    23.4、Fluent Builder API
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-application-events-and-listeners">
            
                    
                    23.5、应用程序事件与监听器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-web-environment">
            
                    
                    23.6、Web 环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-application-arguments">
            
                    
                    23.7、访问应用程序参数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.8" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-command-line-runner">
            
                    
                    23.8、使用 ApplicationRunner 或 ApplicationRunner
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.9" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-application-exit">
            
                    
                    23.9、应用程序退出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.1.10" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-application-admin">
            
                    
                    23.10、管理功能
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config">
            
                    
                    24、外部化配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-random-values">
            
                    
                    24.1、配置随机值
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-command-line-args">
            
                    
                    24.2、访问命令行属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-application-property-files">
            
                    
                    24.3、应用程序属性文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-profile-specific-properties">
            
                    
                    24.4、特定 Profile 的属性文件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-placeholders-in-properties">
            
                    
                    24.5、属性中的占位符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-encrypting-properties">
            
                    
                    24.6、加密属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-yaml">
            
                    
                    24.7、使用 YAML 代替属性文件
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.7.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-loading-yaml">
            
                    
                    24.7.1、加载 YAML
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.7.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-exposing-yaml-to-spring">
            
                    
                    24.7.2、在 Spring Environment 中将 YAML 暴露为属性
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.7.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-multi-profile-yaml">
            
                    
                    24.7.3、多 profile YAML 文档
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.7.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-yaml-shortcomings">
            
                    
                    24.7.4、YAML 的缺点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.2.8" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-typesafe-configuration-properties">
            
                    
                    24.8、类型安全的配置属性
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.8.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-3rd-party-configuration">
            
                    
                    24.8.1、第三方配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.8.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-relaxed-binding">
            
                    
                    24.8.2、宽松绑定
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.8.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-complex-type-merge">
            
                    
                    24.8.3、合并复杂类型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.8.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-conversion">
            
                    
                    24.8.4、属性转换
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.2.8.4.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-conversion-duration">
            
                    
                    转换 duration
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.8.4.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-conversion-datasize">
            
                    
                    转换 Data Size
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.2.8.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-validation">
            
                    
                    24.8.5、@ConfigurationProperties 验证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2.8.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-external-config-vs-value">
            
                    
                    24.8.6、@ConfigurationProperties 与 @Value 对比
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-profiles">
            
                    
                    25、Profile
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-adding-active-profiles">
            
                    
                    25.1、添加激活 Profile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-programmatically-setting-profiles">
            
                    
                    25.2、以编程方式设置 Profile
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-profile-specific-configuration">
            
                    
                    25.3、特定 Profile 的配置文件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-logging">
            
                    
                    26、日志记录
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.4.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-logging-format">
            
                    
                    26.1、日志格式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-logging-console-output">
            
                    
                    26.2、控制台输出
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.4.2.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-logging-color-coded-output">
            
                    
                    26.2.1、着色输出
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.4.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-logging-file-output">
            
                    
                    26.3、文件输出
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-log-levels">
            
                    
                    26.4、日志等级
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-log-groups">
            
                    
                    26.5、日志组
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-log-configuration">
            
                    
                    26.6、自定义日志配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-logback-extensions">
            
                    
                    26.7、Logback 扩展
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.4.7.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_profile_specific_configuration">
            
                    
                    26.7.1、特定 Profile 配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4.7.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_environment_properties">
            
                    
                    26.7.2、环境属性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-json">
            
                    
                    27、JSON
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.5.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-json-jackson">
            
                    
                    27.1、Jackson
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-json-gson">
            
                    
                    27.2、Gson
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-json-json-b">
            
                    
                    27.3、JSON-B
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-developing-web-applications">
            
                    
                    28、开发 Web 应用程序
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc">
            
                    
                    28.1、Spring Web MVC 框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-auto-configuration">
            
                    
                    28.1.1、Spring MVC 自动配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-message-converters">
            
                    
                    28.1.2、HttpMessageConverters
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-message-codes">
            
                    
                    28.1.3、自定义 JSON Serializer 和 Deserializer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-static-content">
            
                    
                    28.1.5、静态内容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-welcome-page">
            
                    
                    28.1.6、欢迎页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-favicon">
            
                    
                    28.1.7、自定义 Favicon
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-pathmatch">
            
                    
                    28.1.8、路径匹配与内容协商
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.8" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-web-binding-initializer">
            
                    
                    28.1.9、ConfigurableWebBindingInitializer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.9" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-mvc-template-engines">
            
                    
                    28.1.10、模板引擎
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.10" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-error-handling">
            
                    
                    28.1.11、错误处理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.1.10.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-error-handling-custom-error-pages">
            
                    
                    28.1.11.1、自定义错误页面
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.10.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-error-handling-mapping-error-pages-without-mvc">
            
                    
                    28.1.11.2、映射到 Spring MVC 之外的错误页面
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.11" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-hateoas">
            
                    
                    28.1.12、Spring HATEOAS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.1.12" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-cors">
            
                    
                    28.1.13、CORS 支持
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux">
            
                    
                    28.2、Spring WebFlux 框架
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.2.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-auto-configuration">
            
                    
                    28.2.1、Spring WebFlux 自动配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.2.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-httpcodecs">
            
                    
                    28.2.2、使用 HttpMessageReader 和 HttpMessageWriter 作为 HTTP 编解码器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.2.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-static-content">
            
                    
                    28.2.3、静态内容
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.2.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-template-engines">
            
                    
                    28.2.4、模板引擎
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.2.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-error-handling">
            
                    
                    28.2.5、错误处理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.2.5.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-error-handling-custom-error-pages">
            
                    
                    28.2.5.1、自定义错误页面
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.2.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webflux-web-filters">
            
                    
                    28.2.6、Web 过滤器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jersey">
            
                    
                    28.3、JAX-RS 与 Jersey
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-embedded-container">
            
                    
                    28.4、内嵌 Servlet 容器支持
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.4.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-embedded-container-servlets-filters-listeners">
            
                    
                    28.4.1、Servlet、Filter 与 Listener
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.4.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-embedded-container-context-initializer">
            
                    
                    28.4.2、Servlet 上下文初始化
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.4.2.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-embedded-container-servlets-filters-listeners-scanning">
            
                    
                    28.4.2.1、扫描 Servlet、Filter 和 Listener
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.4.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-embedded-container-application-context">
            
                    
                    28.4.3、ServletWebServerApplicationContext
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.4.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-customizing-embedded-containers">
            
                    
                    28.4.4、自定义内嵌 Servlet 容器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.6.4.4.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-programmatic-embedded-container-customization">
            
                    
                    28.4.4.1、以编程方式自定义
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.4.4.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-customizing-configurableservletwebserverfactory-directly">
            
                    
                    28.4.4.2、直接自定义 ConfigurableServletWebServerFactory
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.4.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jsp-limitations">
            
                    
                    28.4.5、JSP 局限
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.6.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-reactive-server">
            
                    
                    28.5、内嵌响应式服务器支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-reactive-server-resources">
            
                    
                    28.6、响应式服务器资源配置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security">
            
                    
                    29、安全
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.7.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-mvc">
            
                    
                    29.1、MVC 安全
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-webflux">
            
                    
                    29.2、WebFlux 安全
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-oauth2">
            
                    
                    29.3、OAuth2
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.7.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-oauth2-client">
            
                    
                    29.3.1、客户端
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.7.3.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-oauth2-common-providers">
            
                    
                    OAuth2 客户端注册常见的提供者
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.7.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-oauth2-server">
            
                    
                    29.3.2、资源服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7.3.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_authorization_server">
            
                    
                    29.3.3、授权服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.7.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-actuator">
            
                    
                    29.4、Actuator 安全
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.7.4.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-security-csrf">
            
                    
                    29.4.1、跨站请求伪造保护
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.8" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-sql">
            
                    
                    30、使用 SQL 数据库
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.8.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-configure-datasource">
            
                    
                    30.1、配置数据源
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.8.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-embedded-database-support">
            
                    
                    30.1.1、内嵌数据库支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.1.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connect-to-production-database">
            
                    
                    30.1.2、连接生产数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.1.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-a-jndi-datasource">
            
                    
                    30.1.3、连接 JNDI 数据源
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.8.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-using-jdbc-template">
            
                    
                    30.2、使用 JdbcTemplate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jpa-and-spring-data">
            
                    
                    30.3、JPA 与 Spring Data JPA
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.8.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jpa-and-spring-data">
            
                    
                    30.3.1、实体类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-jpa-repositories">
            
                    
                    30.3.2、Spring Data JPA 资源库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.3.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-creating-and-dropping-jpa-databases">
            
                    
                    30.3.3、创建和删除 JPA 数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.3.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jpa-in-web-environment">
            
                    
                    30.3.4、在视图中打开 EntityManager
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.8.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-data-jdbc">
            
                    
                    30.4、Spring Data JDBC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-sql-h2-console">
            
                    
                    30.5、使用 H2 的 Web 控制台
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.8.5.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-sql-h2-console-custom-path">
            
                    
                    30.5.1、更改 H2 控制台的路径
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.8.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jooq">
            
                    
                    30.6、使用 jOOQ
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.8.6.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_code_generation">
            
                    
                    30.6.1、代码生成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.6.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_using_dslcontext">
            
                    
                    30.6.2、使用 DSLContext
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.6.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_jooq_sql_dialect">
            
                    
                    30.6.3、jOOQ SQL 方言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8.6.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_customizing_jooq">
            
                    
                    30.6.4、自定义 jOOQ
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-nosql">
            
                    
                    31、使用 NoSQL 技术
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-redis">
            
                    
                    31.1、Redis
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-redis">
            
                    
                    31.1.1、连接 Redis
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-mongodb">
            
                    
                    31.2、MongoDB
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.2.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-mongodb">
            
                    
                    31.2.1、连接 MongoDB 数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.2.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-mongo-template">
            
                    
                    31.2.2、MongoTemplate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.2.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-mongo-repositories">
            
                    
                    31.2.3、Spring Data MongoDB 资源库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.2.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-mongo-embedded">
            
                    
                    31.2.4、内嵌 Mongo
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-neo4j">
            
                    
                    31.3、Neo4j
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-neo4j">
            
                    
                    31.3.1、连接 Neo4j 数据库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-neo4j-embedded">
            
                    
                    31.3.2、使用内嵌模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.3.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-neo4j-ogm-session">
            
                    
                    31.3.3、Neo4jSession
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.3.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-neo4j-repositories">
            
                    
                    31.3.4、Spring Data Neo4j 资源库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-gemfire">
            
                    
                    31.4、Gemfire
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-solr">
            
                    
                    31.5、Solr
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.5.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-solr">
            
                    
                    31.5.1、连接 Solr
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.5.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-solr-repositories">
            
                    
                    31.5.2、Spring Data Solr 资源库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-elasticsearch">
            
                    
                    31.6、Elasticsearch
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.6.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-elasticsearch-rest">
            
                    
                    31.6.1、使用 REST 客户端连接 Elasticsearch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.6.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-elasticsearch-jest">
            
                    
                    31.6.2、使用 Jest 连接 Elasticsearch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.6.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-elasticsearch-spring-data">
            
                    
                    31.6.3、使用 Spring Data 连接 Elasticsearch
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.6.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-elasticsearch-repositories">
            
                    
                    31.6.4、Spring Data Elasticsearch 资源库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-cassandra">
            
                    
                    31.7、Cassandra
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.7.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-cassandra">
            
                    
                    31.7.1、连接 Cassandra
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.7.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-cassandra-repositories">
            
                    
                    31.7.2、Spring Data Cassandra 资源库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.8" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-couchbase">
            
                    
                    31.8、Couchbase
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.8.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-couchbase">
            
                    
                    31.8.1、连接 Couchbase
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.8.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spring-data-couchbase-repositories">
            
                    
                    31.8.2、Spring Data Couchbase 资源库
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.9" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-ldap">
            
                    
                    31.9、LDAP
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.9.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-ldap-connecting">
            
                    
                    31.9.1、连接 LDAP 服务器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.9.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-ldap-spring-data-repositories">
            
                    
                    31.9.2、Spring Data LDAP 资源库
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9.9.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-ldap-embedded">
            
                    
                    31.9.3、内嵌内存式 LDAP 服务器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.9.10" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-influxdb">
            
                    
                    31.10、InfluxDB
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.9.10.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-connecting-to-influxdb">
            
                    
                    31.10.1、连接 InfluxDB
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.10" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching">
            
                    
                    32、缓存
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.10.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider">
            
                    
                    32.1、支持的缓存提供者
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.10.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-generic">
            
                    
                    32.1.1、Generic
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-jcache">
            
                    
                    32.1.2、JCache (JSR-107)
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-ehcache2">
            
                    
                    32.1.3、EhCache 2.x
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-hazelcast">
            
                    
                    32.1.4、Hazelcast
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-infinispan">
            
                    
                    32.1.5、Infinispan
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-couchbase">
            
                    
                    32.1.6、Couchbase
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-redis">
            
                    
                    32.1.7、Redis
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.8" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-caffeine">
            
                    
                    32.1.8、Caffeine
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.9" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-simple">
            
                    
                    32.1.9、Simple
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.10.1.10" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-caching-provider-none">
            
                    
                    32.1.10、None
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.11" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-messaging">
            
                    
                    33、消息传递
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.11.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jms">
            
                    
                    33.1、JMS
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.11.1.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-activemq">
            
                    
                    33.1.1、ActiveMQ 支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.1.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-artemis">
            
                    
                    33.1.2、Artemis 支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.1.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jms-jndi">
            
                    
                    33.1.3、使用 JNDI ConnectionFactory
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.1.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-using-jms-sending">
            
                    
                    33.1.4、发送消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.1.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-using-jms-receiving">
            
                    
                    33.1.5、接收消息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.11.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-amqp">
            
                    
                    33.2、AMQP
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.11.2.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-rabbitmq">
            
                    
                    33.2.1、RabbitMQ 支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.2.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-using-amqp-sending">
            
                    
                    33.2.2、发送消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.2.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-using-amqp-receiving">
            
                    
                    33.2.3、接收消息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.11.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kafka">
            
                    
                    33.3、Apache Kafka 支持
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.11.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kafka-sending-a-message">
            
                    
                    33.3.1、发送消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kafka-receiving-a-message">
            
                    
                    33.3.2、接收消息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.3.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kafka-streams">
            
                    
                    33.3.3、Kafka Stream
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.11.3.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kafka-extra-props">
            
                    
                    33.3.4、其他 Kafka 属性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.12" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-resttemplate">
            
                    
                    34、使用 RestTemplate 调用 REST 服务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.12.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-resttemplate-customization">
            
                    
                    34.1、自定义 RestTemplate
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.12.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-resttemplate">
            
                    
                    34、使用 RestTemplate 调用 REST 服务
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.13" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webclient">
            
                    
                    35、使用 WebClient 调用 REST 服务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.13.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webclient-runtime">
            
                    
                    35.1、WebClient 运行时
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.13.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webclient-customization">
            
                    
                    35.2、自定义 WebClient
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.14" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-validation">
            
                    
                    36、验证
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.15" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-email">
            
                    
                    37、发送邮件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.16" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jta">
            
                    
                    38、JTA 分布式事务
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.16.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jta-atomikos">
            
                    
                    38.1、使用 Atomikos 事务管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.16.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jta-bitronix">
            
                    
                    38.2、使用 Bitronix 事务管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.16.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jta-javaee">
            
                    
                    38.3、使用 Java EE 管理的事务管理器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.16.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jta-mixed-jms">
            
                    
                    38.4、混合使用 XA 与非 XA JMS 连接
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.17" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-hazelcast">
            
                    
                    39、Hazelcast
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.18" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-quartz">
            
                    
                    40、Quartz 调度器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.19" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-task-execution-scheduling">
            
                    
                    41、任务执行与调度
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.20" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-integration">
            
                    
                    42、Spring Integration
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.21" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-session">
            
                    
                    43、Spring Session
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.22" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-jmx">
            
                    
                    44、通过 JMX 监控和管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.23" >
            
                <span>
            
                    
                    45、测试
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.24" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-websockets">
            
                    
                    46、WebSocket
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.25" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webservices">
            
                    
                    47、Web Service
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.25.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-webservices-template">
            
                    
                    47.1、使用 WebServiceTemplate 调用 Web Service
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.26" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-developing-auto-configuration">
            
                    
                    49、创建自己的自动配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.26.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-understanding-auto-configured-beans">
            
                    
                    49.1、理解自定配置 Bean
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-locating-auto-configuration-candidates">
            
                    
                    49.2、找到候选的自动配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-condition-annotations">
            
                    
                    49.3、条件注解
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.26.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-class-conditions">
            
                    
                    49.3.1、类条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-bean-conditions">
            
                    
                    49.3.2、Bean 条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.3.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-property-conditions">
            
                    
                    49.3.3、属性条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.3.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-resource-conditions">
            
                    
                    49.3.4、资源条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.3.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-web-application-conditions">
            
                    
                    49.3.5、Web 应用程序条件
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.3.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-spel-conditions">
            
                    
                    49.3.6、SpEL 表达式条件
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.26.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-test-autoconfig">
            
                    
                    49.4、测试自动配置
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.26.4.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_simulating_a_web_context">
            
                    
                    49.4.1、模拟一个 Web 上下文
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.4.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#_overriding_the_classpath">
            
                    
                    49.4.2、覆盖 Classpath
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.26.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-starter">
            
                    
                    49.5、创建自己的 Starter
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.26.5.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-starter-naming">
            
                    
                    49.5.1、命名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.5.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-starter-module-autoconfigure">
            
                    
                    49.5.2、autoconfigure 模块
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.26.5.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-custom-starter-module-starter">
            
                    
                    49.5.3、Starter 模块
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.27" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin">
            
                    
                    50、Kotlin 支持
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.27.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-requirements">
            
                    
                    50.1、要求
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-null-safety">
            
                    
                    50.2、Null 安全
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.3" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-api">
            
                    
                    50.3、Kotlin API
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.27.3.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-api-runapplication">
            
                    
                    50.3.1、runApplication
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.3.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-api-extensions">
            
                    
                    50.3.2、扩展
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.27.4" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-dependency-management">
            
                    
                    50.4、依赖管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.5" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-configuration-properties">
            
                    
                    50.5、@ConfigurationProperties
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.6" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-testing">
            
                    
                    50.6、测试
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.7" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-resources">
            
                    
                    50.7、资源
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.27.7.1" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-resources-further-reading">
            
                    
                    50.7.1、进阶阅读
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.27.7.2" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-kotlin-resources-examples">
            
                    
                    50.7.2、示例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6.28" data-path="spring-boot-features.html">
            
                <a href="spring-boot-features.html#boot-features-whats-next">
            
                    
                    51、下一步
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready">
            
                    
                    五、Spring Boot Actuator: 生产就绪功能
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-enabling">
            
                    
                    52、启用生产就绪功能
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints">
            
                    
                    53、端点
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.2.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-enabling-endpoints">
            
                    
                    53.1、启用端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-exposing-endpoints">
            
                    
                    53.2、暴露端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-security">
            
                    
                    53.3、保护 HTTP 端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-caching">
            
                    
                    53.4、配置端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-hypermedia">
            
                    
                    53.5、Actuator Web 端点超媒体
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.6" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-cors">
            
                    
                    53.6、跨域支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.7" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-custom">
            
                    
                    53.7、实现自定义端点
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.2.7.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-custom-input">
            
                    
                    53.7.1、接收输入
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.7.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-custom-web">
            
                    
                    53.7.2、自定义 Web 端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.7.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-custom-servlet">
            
                    
                    53.7.3、Servlet 端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.7.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-custom-controller">
            
                    
                    53.7.4、控制器端点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.2.8" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-endpoints-custom-controller">
            
                    
                    53.8、健康信息
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.2.8.1" data-path="production-ready.html">
            
                <a href="production-ready.html#_auto_configured_healthindicators">
            
                    
                    53.8.1、自动配置的 HealthIndicator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.8.2" data-path="production-ready.html">
            
                <a href="production-ready.html#_writing_custom_healthindicators">
            
                    
                    53.8.2、编写自定义 HealthIndicator
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.8.3" data-path="production-ready.html">
            
                <a href="production-ready.html#reactive-health-indicators">
            
                    
                    53.8.3、响应式健康指示器
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.8.4" data-path="production-ready.html">
            
                <a href="production-ready.html#_auto_configured_reactivehealthindicators">
            
                    
                    53.8.4、自动配置的 ReactiveHealthIndicator
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.2.9" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-application-info">
            
                    
                    53.9、应用程序信息
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.2.9.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-application-info">
            
                    
                    53.9.1、自动配置的 InfoContributor
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.9.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-application-info-env">
            
                    
                    53.9.2、自定义应用程序信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.9.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-application-info-git">
            
                    
                    53.9.3、Git 提交信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.9.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-application-info-build">
            
                    
                    53.9.4、构建信息
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2.9.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-application-info-build">
            
                    
                    53.9.5、编写自定义 InfoContributor
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-monitoring">
            
                    
                    54、通过 HTTP 监控和管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.3.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-customizing-management-server-context-path">
            
                    
                    54.1、自定义 Management 端点路径
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-customizing-management-server-port">
            
                    
                    54.2、自定义 Management 服务器端口
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-management-specific-ssl">
            
                    
                    54.3、配置 Management 的 SSL
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-customizing-management-server-address">
            
                    
                    54.4、配置 Management 服务器地址
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-disabling-http-endpoints">
            
                    
                    54.5、禁用 HTTP 端点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-jmx">
            
                    
                    55、通过 JMX 监控和管理
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.4.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-custom-mbean-names">
            
                    
                    55.1、自定义 MBean 名称
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-disable-jmx-endpoints">
            
                    
                    55.2、禁用 JMX 端点
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-jolokia">
            
                    
                    55.3、通过 HTTP 使用 Jolokia 访问 JMX
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.4.3.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-customizing-jolokia">
            
                    
                    55.3.1、自定义 Jolokia
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4.3.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-disabling-jolokia">
            
                    
                    55.3.2、禁用 Jolokia
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-loggers">
            
                    
                    56、日志记录器
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.5.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-logger-configuration">
            
                    
                    56.1、配置一个日志记录器
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.6" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics">
            
                    
                    57、指标
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.6.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-getting-started">
            
                    
                    57.1、入门
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export">
            
                    
                    57.2、支持的监控系统
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.6.2.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-appoptics">
            
                    
                    57.2.1、AppOptics
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-atlas">
            
                    
                    57.2.2、Atlas
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-datadog">
            
                    
                    57.2.3、Datadog
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-dynatrace">
            
                    
                    57.2.4、Dynatrace
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-elastic">
            
                    
                    57.2.5、Elastic
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.6" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-ganglia">
            
                    
                    57.2.6、Ganglia
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.7" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-graphite">
            
                    
                    57.2.7、Graphite
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.8" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-humio">
            
                    
                    57.2.8、Humio
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.9" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-influx">
            
                    
                    57.2.9、Influx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.10" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-jmx">
            
                    
                    57.2.10、JMX
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.11" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-kairos">
            
                    
                    57.2.11、KairosDB
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.12" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-newrelic">
            
                    
                    57.2.12、New Relic
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.13" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-prometheus">
            
                    
                    57.2.13、Prometheus
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.14" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-signalfx">
            
                    
                    57.2.14、SignalFx
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.15" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-simple">
            
                    
                    57.2.15、Simple
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.16" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-statsd">
            
                    
                    57.2.16、StatsD
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.2.17" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-export-wavefront">
            
                    
                    57.2.17、Wavefront
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.6.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-meter">
            
                    
                    57.3、支持的指标
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.6.3.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-spring-mvc">
            
                    
                    57.3.1、Spring MVC 指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-web-flux">
            
                    
                    57.3.2、Spring WebFlux 指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.3" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-jersey-server">
            
                    
                    57.3.3、Jersey Server 指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-http-clients">
            
                    
                    57.3.4、HTTP Client 指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-cache">
            
                    
                    57.3.5、Cache 指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.6" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-jdbc">
            
                    
                    57.3.6、数据源指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.7" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-hibernate">
            
                    
                    57.3.7、Hibernate 指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.3.8" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-rabbitmq">
            
                    
                    57.3.8、RabbitMQ 指标
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.6.4" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-custom">
            
                    
                    57.4、注册自定义指标
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.5" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-per-meter-properties">
            
                    
                    57.5、自定义单独指标
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.6.5.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-common-tags">
            
                    
                    57.5.1、自定义标签
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.6.5.2" data-path="production-ready.html">
            
                <a href="production-ready.html#_per_meter_properties">
            
                    
                    57.5.2、Per-meter 属性
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.6.6" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-metrics-endpoint">
            
                    
                    57.6、指标端点
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.7" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-auditing">
            
                    
                    58、审计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.8" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-http-tracing">
            
                    
                    59、HTTP 追踪
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.8.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-http-tracing-custom">
            
                    
                    59.1、自定义 HTTP 追踪
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.9" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-process-monitoring">
            
                    
                    60、进程监控
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.9.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-process-monitoring-configuration">
            
                    
                    60.1、扩展配置
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.9.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-process-monitoring-configuration">
            
                    
                    60.2、编程方式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.10" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-cloudfoundry">
            
                    
                    61、Cloud Foundry 支持
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.10.1" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-cloudfoundry-disable">
            
                    
                    61.1、禁用 Cloud Foundry Actuator 扩展支持
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10.2" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-cloudfoundry-ssl">
            
                    
                    61.2、Cloud Foundry 自签名证书
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.10.3" data-path="production-ready.html">
            
                <a href="production-ready.html#_custom_context_path">
            
                    
                    61.3、自定义上下文路径
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7.11" data-path="production-ready.html">
            
                <a href="production-ready.html#production-ready-auditing">
            
                    
                    62、下一步
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="deployment.html">
            
                <a href="deployment.html">
            
                    
                    六、部署 Spring Boot 应用程序
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" >
            
                <span>
            
                    
                    63、部署到云端
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" >
            
                <span>
            
                    
                    64、安装 Spring Boot 应用程序
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" >
            
                <span>
            
                    
                    65、下一步
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" >
            
                <span>
            
                    
                    七、Spring Boot CLI
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" >
            
                <span>
            
                    
                    66、安装 CLI
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" >
            
                <span>
            
                    
                    67、使用 CLI
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" >
            
                <span>
            
                    
                    68、使用 Groovy Beans DSL 部署应用程序
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" >
            
                <span>
            
                    
                    69、使用  配置 CLI
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" >
            
                <span>
            
                    
                    70、下一步
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" >
            
                <span>
            
                    
                    八、构建工具插件
            
                </span>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" >
            
                <span>
            
                    
                    71、Spring Boot Maven 插件
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" >
            
                <span>
            
                    
                    72、Spring Boot Gradle 插件
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" >
            
                <span>
            
                    
                    73、Spring Boot AntLib 模块
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" >
            
                <span>
            
                    
                    74、支持其他构建系统
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" >
            
                <span>
            
                    
                    75、下一步
            
                </span>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            本书使用 GitBook 发布
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >三、使用 Spring Boot</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div class="search-plus" id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <p><a id="using-boot"></a></p>
<h1 id="&#x4E09;&#x3001;&#x4F7F;&#x7528;-spring-boot">&#x4E09;&#x3001;&#x4F7F;&#x7528; Spring Boot</h1>
<p>&#x672C;&#x7AE0;&#x8282;&#x5C06;&#x8BE6;&#x7EC6;&#x4ECB;&#x7ECD;&#x5982;&#x4F55;&#x4F7F;&#x7528; Spring Boot&#x3002;&#x5B83;&#x8986;&#x76D6;&#x4E86;&#x8BF8;&#x5982;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#x3001;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x548C;&#x5982;&#x4F55;&#x8FD0;&#x884C;&#x5E94;&#x7528;&#x7B49;&#x4E3B;&#x9898;&#x3002;&#x6211;&#x4EEC;&#x8FD8;&#x4ECB;&#x7ECD;&#x4E00;&#x4E9B; Spring Boot &#x6700;&#x4F73;&#x5B9E;&#x8DF5;&#x3002;&#x867D;&#x7136; Spring Boot &#x5E76;&#x6CA1;&#x6709;&#x4EC0;&#x4E48;&#x7279;&#x522B;&#xFF08;&#x5B83;&#x53EA;&#x662F;&#x53E6;&#x4E00;&#x4E2A;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x7684;&#x7C7B;&#x5E93;&#xFF09;&#xFF0C;&#x4F46;&#x4ECD;&#x7136;&#x6709;&#x4E00;&#x4E9B;&#x5EFA;&#x8BAE;&#x53EF;&#x4EE5;&#x8BA9;&#x60A8;&#x7684;&#x5F00;&#x53D1;&#x5DE5;&#x4F5C;&#x53D8;&#x5F97;&#x66F4;&#x52A0;&#x5BB9;&#x6613;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x662F;&#x521A;&#x5F00;&#x59CB;&#x4F7F;&#x7528; Spring Boot&#xFF0C;&#x90A3;&#x4E48;&#x5728;&#x6DF1;&#x5165;&#x672C;&#x90E8;&#x5206;&#x4E4B;&#x524D;&#xFF0C;&#x60A8;&#x5E94;&#x8BE5;&#x5148;&#x9605;&#x8BFB;<a href="#getting-started">&#x5165;&#x95E8;&#x90E8;&#x5206;</a>&#x3002;</p>
<p><a id="using-boot-build-systems"></a></p>
<h2 id="13&#x3001;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;">13&#x3001;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;</h2>
<p>&#x5F3A;&#x70C8;&#x63A8;&#x8350;&#x60A8;&#x9009;&#x62E9;&#x4E00;&#x4E2A;&#x652F;&#x6301;<a href="#using-boot-dependency-management">&#x4F9D;&#x8D56;&#x7BA1;&#x7406;</a>&#x7684;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;, &#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x5B83;&#x5C06; artifact &#x53D1;&#x5E03;&#x5230; Maven Central &#x4ED3;&#x5E93;&#x3002;&#x6211;&#x4EEC;&#x5EFA;&#x8BAE;&#x60A8;&#x9009;&#x62E9; Maven &#x6216;&#x8005; Gradle&#x3002;&#x867D;&#x7136;&#x53EF;&#x4EE5;&#x8BA9; Spring Boot &#x4E0E;&#x5176;&#x5B83;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#xFF08;&#x5982; Ant&#xFF09;&#x914D;&#x5408;&#x5DE5;&#x4F5C;&#xFF0C;&#x4F46;&#x5B83;&#x4EEC;&#x4E0D;&#x4F1A;&#x5F97;&#x5230;&#x7279;&#x522B;&#x597D;&#x7684;&#x652F;&#x6301;&#x3002;</p>
<p><a id="using-boot-dependency-management"></a></p>
<h3 id="131&#x3001;&#x4F9D;&#x8D56;&#x7BA1;&#x7406;">13.1&#x3001;&#x4F9D;&#x8D56;&#x7BA1;&#x7406;</h3>
<p>&#x6BCF;&#x4E00;&#x6B21; Spring Boot &#x53D1;&#x884C;&#x90FD;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x5B83;&#x6240;&#x652F;&#x6301;&#x7684;&#x4F9D;&#x8D56;&#x6E05;&#x5355;&#x3002;&#x5B9E;&#x9645;&#x4E0A;&#xFF0C;&#x60A8;&#x4E0D;&#x9700;&#x8981;&#x4E3A;&#x6784;&#x5EFA;&#x914D;&#x7F6E;&#x63D0;&#x4F9B;&#x4EFB;&#x4F55;&#x4F9D;&#x8D56;&#x7684;&#x7248;&#x672C;&#xFF0C;&#x56E0;&#x4E3A; Spring Boot &#x5DF2;&#x7ECF;&#x5E2E;&#x60A8;&#x7BA1;&#x7406;&#x8FD9;&#x4E9B;&#x4E86;&#x3002;&#x5F53;&#x60A8;&#x5347;&#x7EA7; Spring Boot &#x65F6;&#xFF0C;&#x8FD9;&#x4E9B;&#x4F9D;&#x8D56;&#x4E5F;&#x5C06;&#x4EE5;&#x4E00;&#x81F4;&#x7684;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x5347;&#x7EA7;&#x3002;</p>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x5982;&#x679C;&#x60A8;&#x89C9;&#x5F97;&#x6709;&#x5FC5;&#x8981;&#xFF0C;&#x60A8;&#x4ECD;&#x7136;&#x53EF;&#x4EE5;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x7248;&#x672C;&#x5E76;&#x8986;&#x76D6; Spring Boot &#x6240;&#x63A8;&#x8350;&#x7684;&#x3002;</p>
</blockquote>
<p>&#x8BE5;&#x6E05;&#x5355;&#x5305;&#x542B;&#x4E86;&#x5168;&#x90E8;&#x53EF;&#x4EE5;&#x4E0E; Spring Boot &#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x7684; spring &#x6A21;&#x5757;&#x4EE5;&#x53CA;&#x7B2C;&#x4E09;&#x65B9;&#x7C7B;&#x5E93;&#xFF0C;&#x53EF;&#x4F5C;&#x4E3A;&#x6807;&#x51C6;<a href="#using-boot-maven-without-a-parent">&#x6750;&#x6599;&#x6E05;&#x5355;&#xFF08;<code>spring-boot-dependencies</code>&#xFF09;</a>&#xFF0C;&#x5E76;&#x4E14;&#x53EF;&#x4EE5;&#x4E0E; <a href="#using-boot-maven-parent-pom">Maven</a> &#x548C; <a href="#using-boot-gradle">Gradle</a> &#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x3002;</p>
<p><strong>&#x8B66;&#x544A;</strong></p>
<blockquote>
<p>Spring Boot &#x7684;&#x6BCF;&#x4E00;&#x6B21;&#x53D1;&#x884C;&#x90FD;&#x4F1A;&#x57FA;&#x4E8E;&#x4E00;&#x4E2A; Spring Framework &#x7248;&#x672C;&#xFF0C;&#x56E0;&#x6B64;&#x6211;&#x4EEC;<strong>&#x5F3A;&#x70C8;</strong>&#x5EFA;&#x8BAE;&#x60A8;&#x4E0D;&#x8981;&#x6307;&#x5B9A;&#x6307;&#x5B9A;&#x5B83;&#x7684;&#x7248;&#x672C;&#x3002;</p>
</blockquote>
<p><a id="using-boot-maven"></a></p>
<h3 id="132&#x3001;maven">13.2&#x3001;Maven</h3>
<p>Maven &#x7528;&#x6237;&#x53EF;&#x4EE5;&#x7EE7;&#x627F; <code>spring-boot-starter-parent</code> &#x9879;&#x76EE;&#x4EE5;&#x83B7;&#x53D6;&#x5408;&#x9002;&#x7684;&#x9ED8;&#x8BA4;&#x503C;&#xFF0C;&#x7236;&#x9879;&#x76EE;&#x63D0;&#x4F9B;&#x4E86;&#x4EE5;&#x4E0B;&#x529F;&#x80FD;&#xFF1A;</p>
<ul>
<li>Java 1.8 &#x4F5C;&#x4E3A;&#x9ED8;&#x8BA4;&#x7F16;&#x8BD1;&#x5668;&#x7EA7;&#x522B;&#x3002;</li>
<li>&#x6E90;&#x4EE3;&#x7801;&#x4F7F;&#x7528; UTF-8 &#x7F16;&#x7801;&#x3002;</li>
<li><a href="#using-boot-dependency-management">&#x4F9D;&#x8D56;&#x7BA1;&#x7406;&#x90E8;&#x5206;</a>&#x7EE7;&#x627F;&#x81EA; <code>spring-boot-dependencies</code> &#x7684; POM&#xFF0C;&#x5141;&#x8BB8;&#x60A8;&#x7701;&#x7565;&#x5E38;&#x89C1;&#x4F9D;&#x8D56;&#x7684; <code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span></code> &#x6807;&#x7B7E;&#x3002;</li>
<li>&#x5408;&#x7406;&#x7684;<a href="https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html" target="_blank">&#x8D44;&#x6E90;&#x8FC7;&#x6EE4;</a>&#x3002;</li>
<li>&#x5408;&#x9002;&#x7684;&#x63D2;&#x4EF6;&#x914D;&#x7F6E;&#xFF08;<a href="http://www.mojohaus.org/exec-maven-plugin/" target="_blank">exec plugin</a>&#x3001;<a href="https://github.com/ktoso/maven-git-commit-id-plugin" target="_blank">Git commit ID</a>&#x3001;<a href="https://maven.apache.org/plugins/maven-shade-plugin/" target="_blank">shade</a>&#xFF09;&#x3002;</li>
<li>&#x9488;&#x5BF9; <code>application.properties</code> &#x548C; <code>application.yml</code> &#x8D44;&#x6E90;&#x7684;&#x5408;&#x7406;&#x8FC7;&#x6EE4;&#xFF0C;&#x5305;&#x62EC;&#x7279;&#x5B9A; profile &#x7684;&#x6587;&#x4EF6;&#xFF08;&#x4F8B;&#x5982; <code>application-foo.properties</code> &#x548C; <code>application-foo.yml</code>&#xFF09;</li>
</ul>
<p>&#x6CE8;&#x610F;&#xFF1A;&#x7531;&#x4E8E; <code>application.properties</code> &#x548C; <code>application.yml</code> &#x6587;&#x4EF6;&#x63A5;&#x53D7; Spring &#x98CE;&#x683C;&#x7684;&#x5360;&#x4F4D;&#x7B26;&#xFF08;<code>${&#x200B;...}</code>&#xFF09;&#xFF0C;&#x56E0;&#x6B64; Maven &#x8FC7;&#x6EE4;&#x6539;&#x4E3A;&#x4F7F;&#x7528; <code>@..@</code> &#x5360;&#x4F4D;&#x7B26;&#xFF08;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; Maven &#x7684; <code>resource.delimiter</code> &#x5C5E;&#x6027;&#x91CD;&#x5199;&#x5B83;&#xFF09;</p>
<p><a id="using-boot-maven-parent-pom"></a></p>
<h4 id="1321&#x3001;&#x7EE7;&#x627F;-starter-parent">13.2.1&#x3001;&#x7EE7;&#x627F; Starter Parent</h4>
<p>&#x8981;&#x5C06;&#x9879;&#x76EE;&#x914D;&#x7F6E;&#x7EE7;&#x627F; <code>spring-boot-starter-parent</code>&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x6309;&#x4EE5;&#x4E0B;&#x65B9;&#x5F0F;&#x8BBE;&#x7F6E; <code>parent</code>&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token comment">&lt;!-- &#x4ECE; Spring Boot &#x7EE7;&#x627F;&#x9ED8;&#x8BA4;&#x914D;&#x7F6E; --&gt;</span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>parent</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-starter-parent<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>2.0.0.RELEASE<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>parent</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x60A8;&#x53EA;&#x9700;&#x8981;&#x5728;&#x6B64;&#x4F9D;&#x8D56;&#x4E0A;&#x6307;&#x5B9A; Spring Boot &#x7684;&#x7248;&#x672C;&#x53F7;&#x3002;&#x5982;&#x679C;&#x60A8;&#x8981;&#x5BFC;&#x5165;&#x5176;&#x5B83; starter&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x653E;&#x5FC3;&#x5730;&#x7701;&#x7565;&#x7248;&#x672C;&#x53F7;&#x3002;</p>
</blockquote>
<p>&#x901A;&#x8FC7;&#x8BE5;&#x8BBE;&#x7F6E;&#xFF0C;&#x60A8;&#x8FD8;&#x53EF;&#x4EE5;&#x91CD;&#x5199;&#x81EA;&#x5DF1;&#x9879;&#x76EE;&#x4E2D;&#x7684;&#x914D;&#x7F6E;&#x5C5E;&#x6027;&#x6765;&#x8986;&#x76D6;&#x4E2A;&#x522B;&#x4F9D;&#x8D56;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x8981;&#x5347;&#x7EA7;&#x5230;&#x53E6;&#x4E00;&#x4E2A; Spring Data &#x53D1;&#x884C;&#x7248;&#x672C;&#xFF0C;&#x60A8;&#x9700;&#x8981;&#x5C06;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#x6DFB;&#x52A0;&#x5230; <code>pom.xml</code> &#x6587;&#x4EF6;&#x4E2D;&#x3002;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>properties</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>spring-data-releasetrain.version</span><span class="token punctuation">&gt;</span></span>Fowler-SR2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>spring-data-releasetrain.version</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>properties</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x67E5;&#x770B; <a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-dependencies/pom.xml" target="_blank"><code>spring-boot-dependencies</code> pom</a> &#x4EE5;&#x83B7;&#x53D6;&#x53D7;&#x652F;&#x6301;&#x7684;&#x5C5E;&#x6027;&#x6E05;&#x5355;&#x3002;</p>
</blockquote>
<p><a id="using-boot-maven-without-a-parent"></a></p>
<h4 id="1322&#x3001;&#x4E0D;&#x4F7F;&#x7528;&#x7236;-pom">13.2.2&#x3001;&#x4E0D;&#x4F7F;&#x7528;&#x7236; POM</h4>
<p>&#x4E0D;&#x662F;&#x6BCF;&#x4E2A;&#x4EBA;&#x90FD;&#x559C;&#x6B22;&#x4ECE; <code>spring-boot-starter-parent</code> &#x7EE7;&#x627F; POM&#x3002;&#x60A8;&#x53EF;&#x80FD;&#x9700;&#x8981;&#x4F7F;&#x7528;&#x81EA;&#x5DF1;&#x516C;&#x53F8;&#x6807;&#x51C6;&#x7684;&#x7236; POM&#xFF0C;&#x6216;&#x8005;&#x60A8;&#x53EF;&#x80FD;&#x53EA;&#x662F;&#x5E0C;&#x671B;&#x660E;&#x786E;&#x5730;&#x58F0;&#x660E;&#x6240;&#x6709; Maven &#x914D;&#x7F6E;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x4E0D;&#x60F3;&#x4F7F;&#x7528; <code>spring-boot-starter-parent</code>&#xFF0C;&#x5219;&#x4ECD;&#x7136;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4F7F;&#x7528; <code>scope=import</code> &#x4F9D;&#x8D56;&#x6765;&#x83B7;&#x5F97;&#x4F9D;&#x8D56;&#x7BA1;&#x7406;&#xFF08;&#x4F46;&#x4E0D;&#x662F;&#x63D2;&#x4EF6;&#x7BA1;&#x7406;&#xFF09;&#x7684;&#x597D;&#x5904;&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencyManagement</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencies</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token comment">&lt;!-- &#x4ECE; Spring Boot &#x5BFC;&#x5165;&#x4F9D;&#x8D56;&#x7BA1;&#x7406; --&gt;</span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-dependencies<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>2.0.0.RELEASE<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>type</span><span class="token punctuation">&gt;</span></span>pom<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>type</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>import<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencies</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencyManagement</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p>&#x5982;&#x4E0A;&#x6240;&#x8FF0;&#xFF0C;&#x4E0A;&#x8FF0;&#x793A;&#x4F8B;&#x8BBE;&#x7F6E;&#x4E0D;&#x4F1A;&#x8BA9;&#x60A8;&#x4F7F;&#x7528;&#x5C5E;&#x6027;&#x6765;&#x8986;&#x76D6;&#x4E2A;&#x522B;&#x4F9D;&#x8D56;&#x3002;&#x8981;&#x8FBE;&#x5230;&#x76F8;&#x540C;&#x7684;&#x76EE;&#x7684;&#xFF0C;&#x9700;&#x8981;&#x5728; <code>spring-boot-dependencies</code> &#x9879;<strong>&#x4E4B;&#x524D;</strong>&#x5728;&#x9879;&#x76EE;&#x7684; <code>dependencyManagement</code> &#x4E2D;&#x6DFB;&#x52A0;&#x4E00;&#x9879;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x8981;&#x5347;&#x7EA7;&#x5230;&#x53E6;&#x4E00;&#x4E2A; Spring Data &#x53D1;&#x884C;&#x7248;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x5C06;&#x4EE5;&#x4E0B;&#x5143;&#x7D20;&#x6DFB;&#x52A0;&#x5230; <code>pom.xml</code>&#x4E2D;&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencyManagement</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencies</span><span class="token punctuation">&gt;</span></span>
        <span class="token comment">&lt;!-- &#x8986;&#x76D6; Spring Boot &#x63D0;&#x4F9B;&#x7684; Spring Data --&gt;</span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.data<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-data-releasetrain<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>Fowler-SR2<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>type</span><span class="token punctuation">&gt;</span></span>pom<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>type</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>import<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-dependencies<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>version</span><span class="token punctuation">&gt;</span></span>2.0.0.RELEASE<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>version</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>type</span><span class="token punctuation">&gt;</span></span>pom<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>type</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>scope</span><span class="token punctuation">&gt;</span></span>import<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>scope</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencies</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencyManagement</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x4EE5;&#x4E0A;&#x793A;&#x4F8B;&#x4E2D;&#xFF0C;&#x6211;&#x4EEC;&#x6307;&#x5B9A;&#x4E86;&#x4E00;&#x4E2A; <strong>BOM</strong>&#xFF0C;&#x4F46;&#x662F;&#x4EFB;&#x4F55;&#x7684;&#x4F9D;&#x8D56;&#x7C7B;&#x578B;&#x90FD;&#x53EF;&#x4EE5;&#x7528;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x6765;&#x91CD;&#x5199;&#x3002;</p>
</blockquote>
<p><a id="using-boot-maven-plugin"></a></p>
<h4 id="1323&#x3001;&#x4F7F;&#x7528;-spring-boot-maven-&#x63D2;&#x4EF6;">13.2.3&#x3001;&#x4F7F;&#x7528; Spring Boot Maven &#x63D2;&#x4EF6;</h4>
<p>Spring Boot &#x5305;&#x62EC;&#x4E86;&#x4E00;&#x4E2A; <a href="#build-tool-plugins-maven-plugin">Maven &#x63D2;&#x4EF6;</a>&#xFF0C;&#x5B83;&#x53EF;&#x4EE5;&#x5C06;&#x9879;&#x76EE;&#x6253;&#x5305;&#x6210;&#x4E00;&#x4E2A;&#x53EF;&#x6267;&#x884C; jar&#x3002;&#x5982;&#x679C;&#x8981;&#x4F7F;&#x7528;&#x5B83;&#xFF0C;&#x8BF7;&#x5C06;&#x63D2;&#x4EF6;&#x6DFB;&#x52A0;&#x5230;&#x60A8;&#x7684; <code><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugins</span><span class="token punctuation">&gt;</span></span></code> &#x4E2D;&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>build</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugins</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugin</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-maven-plugin<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>plugin</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>plugins</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>build</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528;&#x4E86; Spring Boot starter &#x7684;&#x7236; pom&#xFF0C;&#x5219;&#x53EA;&#x9700;&#x8981;&#x6DFB;&#x52A0;&#x63D2;&#x4EF6;&#x3002;&#x9664;&#x975E;&#x60A8;&#x8981;&#x4FEE;&#x6539;&#x7236;&#x7EA7;&#x4E2D;&#x5B9A;&#x4E49;&#x7684;&#x8BBE;&#x7F6E;&#xFF0C;&#x5426;&#x5219;&#x4E0D;&#x9700;&#x8981;&#x8FDB;&#x884C;&#x914D;&#x7F6E;&#x3002;</p>
</blockquote>
<p><a id="using-boot-gradle"></a></p>
<h3 id="133&#x3001;gradle">13.3&#x3001;Gradle</h3>
<p>&#x8981;&#x4E86;&#x89E3;&#x5982;&#x4F55;&#x4F7F;&#x7528; Spring Boot &#x548C; Gradle&#xFF0C;&#x8BF7;&#x53C2;&#x9605; Spring Boot &#x7684; Gradle &#x63D2;&#x4EF6;&#x6587;&#x6863;&#xFF1A;</p>
<ul>
<li>&#x53C2;&#x8003;&#x6587;&#x6863;&#xFF08;<a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/gradle-plugin/reference/html" target="_blank">HTML</a> &#x4E0E; <a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/gradle-plugin/reference/pdf/spring-boot-gradle-plugin-reference.pdf" target="_blank">PDF</a>&#xFF09;</li>
<li><a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/gradle-plugin/api" target="_blank">API</a></li>
</ul>
<p><a id="using-boot-ant"></a></p>
<h3 id="134&#x3001;ant">13.4&#x3001;Ant</h3>
<p>&#x53EF;&#x4EE5;&#x4F7F;&#x7528; Apache Ant+Ivy &#x6784;&#x5EFA; Spring Boot &#x9879;&#x76EE;&#x3002;<code>spring-boot-antlib</code> AntLib &#x6A21;&#x5757;&#x4E5F;&#x53EF;&#x4EE5;&#x5E2E;&#x52A9; Ant &#x521B;&#x5EFA;&#x53EF;&#x6267;&#x884C; jar &#x6587;&#x4EF6;&#x3002;</p>
<p>&#x8981;&#x58F0;&#x660E;&#x4F9D;&#x8D56;&#xFF0C;&#x53EF;&#x53C2;&#x8003;&#x4EE5;&#x4E0B;&#x4E00;&#x4E2A;&#x5178;&#x578B;&#x7684; <code>ivy.xml</code> &#x6587;&#x4EF6;&#x5185;&#x5BB9;&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>ivy-module</span> <span class="token attr-name">version</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>2.0<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>info</span> <span class="token attr-name">organisation</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>org.springframework.boot<span class="token punctuation">&quot;</span></span> <span class="token attr-name">module</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>spring-boot-sample-ant<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>configurations</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>conf</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile<span class="token punctuation">&quot;</span></span> <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>everything needed to compile this module<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>conf</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>runtime<span class="token punctuation">&quot;</span></span> <span class="token attr-name">extends</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile<span class="token punctuation">&quot;</span></span> <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>everything needed to run this module<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>configurations</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencies</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span> <span class="token attr-name">org</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>org.springframework.boot<span class="token punctuation">&quot;</span></span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>spring-boot-starter<span class="token punctuation">&quot;</span></span>
            <span class="token attr-name">rev</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>${spring-boot.version}<span class="token punctuation">&quot;</span></span> <span class="token attr-name">conf</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencies</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>ivy-module</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p>&#x4E00;&#x4E2A;&#x5178;&#x578B;&#x7684; <code>build.xml</code> &#x5927;&#x6982;&#x662F;&#x8FD9;&#x6837;&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>project</span>
    <span class="token attr-name"><span class="token namespace">xmlns:</span>ivy</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>antlib:org.apache.ivy.ant<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name"><span class="token namespace">xmlns:</span>spring-boot</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>antlib:org.springframework.boot.ant<span class="token punctuation">&quot;</span></span>
    <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>myapp<span class="token punctuation">&quot;</span></span> <span class="token attr-name">default</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>build<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>property</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>spring-boot.version<span class="token punctuation">&quot;</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>2.0.0.RELEASE<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>target</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>resolve<span class="token punctuation">&quot;</span></span> <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>--&gt; retrieve dependencies with ivy<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">ivy:</span>retrieve</span> <span class="token attr-name">pattern</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>lib/[conf]/[artifact]-[type]-[revision].[ext]<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>target</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>target</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>classpaths<span class="token punctuation">&quot;</span></span> <span class="token attr-name">depends</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>resolve<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>path</span> <span class="token attr-name">id</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile.classpath<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>fileset</span> <span class="token attr-name">dir</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>lib/compile<span class="token punctuation">&quot;</span></span> <span class="token attr-name">includes</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>*.jar<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>path</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>target</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>target</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>init<span class="token punctuation">&quot;</span></span> <span class="token attr-name">depends</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>classpaths<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>mkdir</span> <span class="token attr-name">dir</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>build/classes<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>target</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>target</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile<span class="token punctuation">&quot;</span></span> <span class="token attr-name">depends</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>init<span class="token punctuation">&quot;</span></span> <span class="token attr-name">description</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>javac</span> <span class="token attr-name">srcdir</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>src/main/java<span class="token punctuation">&quot;</span></span> <span class="token attr-name">destdir</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>build/classes<span class="token punctuation">&quot;</span></span> <span class="token attr-name">classpathref</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile.classpath<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>target</span><span class="token punctuation">&gt;</span></span>

    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>target</span> <span class="token attr-name">name</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>build<span class="token punctuation">&quot;</span></span> <span class="token attr-name">depends</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>compile<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">spring-boot:</span>exejar</span> <span class="token attr-name">destfile</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>build/myapp.jar<span class="token punctuation">&quot;</span></span> <span class="token attr-name">classes</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>build/classes<span class="token punctuation">&quot;</span></span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token namespace">spring-boot:</span>lib</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>fileset</span> <span class="token attr-name">dir</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">&quot;</span>lib/runtime<span class="token punctuation">&quot;</span></span> <span class="token punctuation">/&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token namespace">spring-boot:</span>lib</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token namespace">spring-boot:</span>exejar</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>target</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>project</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x5982;&#x679C;&#x60A8;&#x4E0D;&#x60F3;&#x4F7F;&#x7528; <code>spring-boot-antlib</code> &#x6A21;&#x5757;&#xFF0C;&#x8BF7;&#x53C2;&#x9605;&#x7B2C; 84.10 &#x8282;&#xFF1A;<a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#howto-build-an-executable-archive-with-ant" target="_blank"><strong>&#x4F7F;&#x7528; Ant &#x6784;&#x5EFA;&#x53EF;&#x6267;&#x884C;&#x5F52;&#x6863;&#x6587;&#x4EF6;</strong></a>&#xFF0C;&#x65E0;&#x9700;&#x4F7F;&#x7528; <code>spring-boot-antlib</code>&#x3002;</p>
</blockquote>
<p><a id="using-boot-starter"></a></p>
<h3 id="135&#x3001;starter">13.5&#x3001;Starter</h3>
<p>Starter &#x662F;&#x4E00;&#x7EC4;&#x60EF;&#x4F8B;&#x4F9D;&#x8D56;&#x63CF;&#x8FF0;&#x8D44;&#x6E90;&#xFF0C;&#x53EF;&#x4EE5;&#x5305;&#x542B;&#x5728;&#x5E94;&#x7528;&#x4E2D;&#x3002;&#x4ECE; starter &#x4E2D;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x83B7;&#x5F97;&#x6240;&#x9700;&#x7684;&#x6240;&#x6709; Spring &#x548C;&#x76F8;&#x5173;&#x6280;&#x672F;&#x7684;&#x4E00;&#x7AD9;&#x5F0F;&#x652F;&#x6301;&#xFF0C;&#x65E0;&#x987B;&#x901A;&#x8FC7;&#x793A;&#x4F8B;&#x4EE3;&#x7801;&#x548C;&#x590D;&#x5236;&#x7C98;&#x8D34;&#x6765;&#x83B7;&#x53D6;&#x4F9D;&#x8D56;&#x3002;&#x6BD4;&#x5982;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x8981;&#x4F7F;&#x7528; Spring &#x548C; JPA &#x8FDB;&#x884C;&#x6570;&#x636E;&#x5E93;&#x8BBF;&#x95EE;&#xFF0C;&#x90A3;&#x4E48;&#x53EA;&#x9700;&#x8981;&#x5728;&#x9879;&#x76EE;&#x4E2D;&#x5305;&#x542B; <code>spring-boot-starter-data-jpa</code> &#x4F9D;&#x8D56;&#x9879;&#x5373;&#x53EF;&#x3002;</p>
<p>starter &#x5305;&#x542B;&#x4E86;&#x8BB8;&#x591A;&#x60A8;&#x9700;&#x8981;&#x7528;&#x4E8E;&#x4F7F;&#x9879;&#x76EE;&#x5FEB;&#x901F;&#x542F;&#x52A8;&#x548C;&#x8FD0;&#x884C;&#xFF0C;&#x5E76;&#x4E14;&#x9700;&#x8981;&#x4E00;&#x7EC4;&#x53D7;&#x652F;&#x6301;&#x7684;&#x53EF;&#x4F20;&#x9012;&#x4F9D;&#x8D56;&#x5173;&#x7CFB;&#x7684;&#x4F9D;&#x8D56;&#x3002;</p>
<hr>
<p><strong>&#x547D;&#x540D;&#x542B;&#x4E49;</strong></p>
<p>&#x5B98;&#x65B9;&#x7684;&#x6240;&#x6709; starter &#x90FD;&#x9075;&#x5FAA;&#x7C7B;&#x4F3C;&#x7684;&#x547D;&#x540D;&#x89C4;&#x5219;&#xFF1A;<code>spring-boot-starter-*</code>&#xFF0C;&#x5176;&#x4E2D; <code>*</code> &#x662F;&#x7279;&#x5B9A;&#x7C7B;&#x578B;&#x7684;&#x5E94;&#x7528;&#x3002;&#x8FD9;&#x4E2A;&#x547D;&#x540D;&#x7ED3;&#x6784;&#x65E8;&#x5728;&#x5E2E;&#x52A9;&#x60A8;&#x627E;&#x5230; starter&#x3002;&#x8BB8;&#x591A; IDE &#x4E2D; Maven &#x96C6;&#x6210;&#x5141;&#x8BB8;&#x60A8;&#x6309;&#x540D;&#x79F0;&#x641C;&#x7D22;&#x4F9D;&#x8D56;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x5B89;&#x88C5;&#x4E86; Eclipse &#x6216;&#x8005; STS &#x63D2;&#x4EF6;&#x540E;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x7B80;&#x5355;&#x5730;&#x5728; POM &#x7F16;&#x8F91;&#x5668;&#x4E2D;&#x6309;&#x4E0B; <code>ctrl-space</code> &#x5E76;&#x8F93;&#x5165; <strong>spring-boot-starter</strong> &#x6765;&#x83B7;&#x53D6;&#x5B8C;&#x6574;&#x7684;&#x5217;&#x8868;&#x3002;</p>
<p>&#x6B63;&#x5982;<a href="#boot-features-custom-starter"><strong>&#x521B;&#x5EFA;&#x81EA;&#x5DF1;&#x7684; starter</strong></a> &#x7AE0;&#x8282;&#x6240;&#x8FF0;&#xFF0C;&#x7B2C;&#x4E09;&#x65B9;&#x7684; starter &#x547D;&#x540D;&#x4E0D;&#x5E94;&#x8BE5;&#x4EE5; <code>spring-boot</code> &#x5F00;&#x5934;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x662F;&#x5B98;&#x65B9; Spring Boot &#x6784;&#x4EF6;&#x6240;&#x4FDD;&#x7559;&#x7684;&#x89C4;&#x5219;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x6709;&#x4E00;&#x4E2A;&#x7B2C;&#x4E09;&#x65B9; starter &#x9879;&#x76EE;&#x53EB;&#x505A; <code>thirdpartyproject</code>&#xFF0C;&#x5B83;&#x901A;&#x5E38;&#x4F1A;&#x547D;&#x540D;&#x4E3A; <code>thirdpartyproject-spring-boot-starter</code>&#x3002;</p>
<hr>
<p>Spring Boot &#x5728; <code>org.springframework.boot</code> group &#x4E0B;&#x63D0;&#x4F9B;&#x4E86;&#x4EE5;&#x4E0B;&#x5E94;&#x7528; starter&#xFF1A;</p>
<p><strong>&#x8868; 13.1&#x3001;Spring Boot &#x5E94;&#x7528;&#x7C7B; Starter</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">&#x540D;&#x79F0;</th>
<th style="text-align:left">&#x63CF;&#x8FF0;</th>
<th style="text-align:center">POM</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>spring-boot-starter</code></td>
<td style="text-align:left">&#x6838;&#x5FC3; starter&#xFF0C;&#x5305;&#x542B;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x652F;&#x6301;&#x3001;&#x65E5;&#x5FD7;&#x548C; YAML</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-activemq</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; JMS &#x6D88;&#x606F;&#x652F;&#x6301;&#xFF0C;&#x4F7F;&#x7528; Apache ActiveMQ</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-activemq/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-amqp</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Spring AMQP &#x4E0E; Rabbit MQ &#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-amqp/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-aop</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Spring AOP &#x4E0E; AspectJ &#x9762;&#x5411;&#x5207;&#x9762;&#x7F16;&#x7A0B;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-aop/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-artemis</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; JMS &#x6D88;&#x606F;&#x670D;&#x52A1;&#x652F;&#x6301;&#xFF0C;&#x4F7F;&#x7528; Apache Artemis</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-artemis/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-batch</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Spring Batch &#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-batch/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-cache</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Spring Framework &#x7F13;&#x5B58;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-cache/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-cloud-connectors</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Spring Cloud Connectors &#x7B80;&#x5355;&#x8FDE;&#x63A5;&#x5230;&#x7C7B;&#x4F3C; Cloud Foundry &#x548C; Heroku &#x7B49;&#x4E91;&#x5E73;&#x53F0;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-cloud-connectors/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-cassandra</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Cassandra &#x5206;&#x5E03;&#x5F0F;&#x6570;&#x636E;&#x5E93;&#x548C; Spring Data Cassandra &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-cassandra-reactive</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Cassandra &#x5206;&#x5E03;&#x5F0F;&#x6570;&#x636E;&#x5E93;&#x548C; Spring Data Cassandra Reactive &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-cassandra-reactive/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-couchbase</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Couchbase &#x9762;&#x5411;&#x6587;&#x6863;&#x6570;&#x636E;&#x5E93;&#x548C; Spring Data Couchbase &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-couchbase-reactive</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Couchbase &#x9762;&#x5411;&#x6587;&#x6863;&#x6570;&#x636E;&#x5E93;&#x548C; Spring Data Couchbase Reactive &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-couchbase-reactive/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-elasticsearch</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Elasticseach &#x641C;&#x7D22;&#x4E0E;&#x5206;&#x6790;&#x5F15;&#x64CE;&#x548C; Spring Data Elasticsearch &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-elasticsearch/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-jpa</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Spring Data JPA &#x4E0E; Hibernate &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-jpa/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-ldap</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Spring Data LDAP &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-ldap/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-mongodb</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; MongoDB &#x9762;&#x5411;&#x6587;&#x6863;&#x6570;&#x636E;&#x5E93;&#x548C; Spring Data MongoDB &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-mongodb-reactive</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; MongoDB &#x9762;&#x5411;&#x6587;&#x6863;&#x6570;&#x636E;&#x5E93;&#x548C; Spring Data MongoDB Reactive &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-mongodb-reactive/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-neo4j</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Neo4j &#x56FE;&#x6570;&#x636E;&#x5E93;&#x4E0E; SPring Data Neo4j &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-neo4j/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-redis</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Redis &#x952E;&#x503C;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x3001;Spring Data Redis &#x548C; Lettuce &#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-redis-reactive</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Redis &#x952E;&#x503C;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x3001;Spring Data Redis Reactive &#x548C; Lettuce &#x5BA2;&#x6237;&#x7AEF;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-redis-reactive/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-rest</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Spring Data REST &#x901A;&#x8FC7; REST &#x66B4;&#x9732; Spring Data &#x8D44;&#x6E90;&#x5E93;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-rest/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-data-solr</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Apache Solr &#x641C;&#x7D22;&#x5E73;&#x53F0;&#x4E0E; Spring Data Solr &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-data-solr/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-freemarker</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Freemakrer &#x89C6;&#x56FE;&#x6784;&#x5EFA; MVC web &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-freemarker/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-groovy-templates</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Groovy &#x6A21;&#x677F;&#x89C6;&#x56FE;&#x6784;&#x5EFA; MVC web &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-groovy-templates/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-hateoas</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Spring MVC &#x4E0E;Spring HATEOAS &#x6784;&#x5EFA;&#x57FA;&#x4E8E;&#x8D85;&#x5A92;&#x4F53;&#x7684; RESTful web &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-hateoas/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-integration</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9; Spring Integration &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-integration/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jdbc</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; JDBC &#x4E0E; Tomcat JDBC &#x8FDE;&#x63A5;&#x6C60;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jdbc/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jersey</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9;&#x4F7F;&#x7528; JAX-RS &#x4E0E; Jersey &#x6784;&#x5EFA; RESTful web &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;&#x3002;<a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-web" target="_blank"><code>spring-boot-starter-web</code></a> &#x7684;&#x66FF;&#x4EE3;&#x65B9;&#x6848;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jersey/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jooq</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5BF9;&#x4F7F;&#x7528; JOOQ &#x8BBF;&#x95EE; SQL &#x6570;&#x636E;&#x5E93;&#x7684;&#x652F;&#x6301;&#x3002;<a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-data-jpa" target="_blank"><code>spring-boot-starter-data-jpa</code></a> &#x6216; <a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-jdbc" target="_blank"><code>spring-boot-starter-jdbc</code></a> &#x7684;&#x66FF;&#x4EE3;&#x65B9;&#x6848;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jooq/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-json</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4E86;&#x8BFB;&#x5199; json &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-json/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jta-atomikos</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Atomikos JTA &#x4E8B;&#x52A1;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-atomikos/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jta-bitronix</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Bitronix JTA &#x4E8B;&#x52A1;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-bitronix/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jta-narayana</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Narayana JTA &#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jta-narayana/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-mail</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528;&#x3000;Java Mail &#x4E0E; Spring Framework &#x7684;&#x90AE;&#x4EF6;&#x53D1;&#x9001;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-mail/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-mustache</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Mustache &#x89C6;&#x56FE;&#x6784;&#x5EFA; web &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-mustache/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-quartz</code></td>
<td style="text-align:left">Quartz &#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-quartz/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-security</code></td>
<td style="text-align:left">Spring Security &#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-security/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-test</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x5305;&#x542B;&#x4E86; JUnit&#x3001;Hamcrest &#x4E0E; Mockito &#x7C7B;&#x5E93;&#x7684; Spring Boot &#x5355;&#x5143;&#x6D4B;&#x8BD5;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-test/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-thymeleaf</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Thymeleaf &#x89C6;&#x56FE;&#x6784;&#x5EFA; MVC web &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-thymeleaf/pom.xml" target="_blank">pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-validation</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B; Hibernate Validator &#x4E0E; Java Bean Validation &#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-validation/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-web</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Spring MVC &#x6784;&#x5EFA; web&#xFF08;&#x5305;&#x542B; RESTful&#xFF09;&#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;&#xFF0C;&#x4F7F;&#x7528; Tomcat &#x4F5C;&#x4E3A;&#x9ED8;&#x8BA4;&#x5D4C;&#x5165;&#x5F0F;&#x5BB9;&#x5668;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-web/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-web-services</code></td>
<td style="text-align:left">Spring Web Services &#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-web-services/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-webflux</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Spring Framework &#x7684; Reactive Web &#x652F;&#x6301;&#x6784;&#x5EFA; WebFlux &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-webflux/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-websocket</code></td>
<td style="text-align:left">&#x63D0;&#x4F9B;&#x4F7F;&#x7528; Spring Framework &#x7684; WebSocket &#x652F;&#x6301;&#x6784;&#x5EFA; WebSocket &#x5E94;&#x7528;&#x7684;&#x652F;&#x6301;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-websocket/pom.xml" target="_blank">Pom</a></td>
</tr>
</tbody>
</table>
<p>&#x9664;&#x4E86;&#x5E94;&#x7528; starter&#xFF0C;&#x4EE5;&#x4E0B; starter &#x53EF;&#x7528;&#x4E8E;&#x6DFB;&#x52A0;<a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#production-ready" target="_blank">&#x751F;&#x4EA7;&#x5C31;&#x7EEA;</a>&#x7279;&#x6027;&#xFF1A;</p>
<p><strong>&#x8868; 13.2&#x3001;Spring Boot &#x751F;&#x4EA7;&#x7C7B; starter</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">&#x540D;&#x79F0;</th>
<th style="text-align:left">&#x63CF;&#x8FF0;</th>
<th style="text-align:center">POM</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>spring-boot-starter-actuator</code></td>
<td style="text-align:left">Spring Boot &#x7684; Actuator &#x652F;&#x6301;&#xFF0C;&#x5176;&#x63D0;&#x4F9B;&#x4E86;&#x751F;&#x4EA7;&#x5C31;&#x7EEA;&#x529F;&#x80FD;&#xFF0C;&#x5E2E;&#x52A9;&#x60A8;&#x76D1;&#x63A7;&#x548C;&#x7BA1;&#x7406;&#x5E94;&#x7528;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-actuator/pom.xml" target="_blank">Pom</a></td>
</tr>
</tbody>
</table>
<p>&#x6700;&#x540E;&#xFF0C;Spring Boot &#x8FD8;&#x5305;&#x542B;&#x4EE5;&#x4E0B; starter&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x60F3;&#x8981;&#x6392;&#x9664;&#x6216;&#x5207;&#x6362;&#x7279;&#x5B9A;&#x6280;&#x672F;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x4EE5;&#x4E0B; starter&#xFF1A;</p>
<p><strong>&#x8868; 13.3&#x3001;Spring Boot &#x6280;&#x672F;&#x7C7B; starter</strong></p>
<table>
<thead>
<tr>
<th style="text-align:left">&#x540D;&#x79F0;</th>
<th style="text-align:left">&#x63CF;&#x8FF0;</th>
<th style="text-align:center">POM</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:left"><code>spring-boot-starter-jetty</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Jetty &#x4F5C;&#x4E3A;&#x5D4C;&#x5165;&#x5F0F; servlet &#x5BB9;&#x5668;&#x3002;&#x53EF;&#x4EE3;&#x66FF; <a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-tomcat" target="_blank"><code>spring-boot-starter-tomcat</code></a></td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-jetty/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-log4j2</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Log4j2 &#x4F5C;&#x4E3A;&#x65E5;&#x5FD7;&#x7EC4;&#x4EF6;&#x3002;&#x53EF;&#x4EE3;&#x66FF; <a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-logging" target="_blank"><code>spring-boot-starter-logging</code></a></td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-log4j2/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-logging</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Logback &#x4F5C;&#x4E3A;&#x65E5;&#x5FD7;&#x7EC4;&#x4EF6;&#xFF0C;&#x6B64; starter &#x4E3A;&#x9ED8;&#x8BA4;&#x7684;&#x65E5;&#x5FD7; starter</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-logging/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-reactor-netty</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Reactor Netty &#x4F5C;&#x4E3A;&#x5185;&#x5D4C;&#x54CD;&#x5E94;&#x5F0F; HTTP &#x670D;&#x52A1;&#x5668;</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-reactor-netty/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-tomcat</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Tomcat &#x4F5C;&#x4E3A;&#x5D4C;&#x5165;&#x5F0F; servlet &#x5BB9;&#x5668;&#xFF0C;&#x6B64;&#x4E3A; <a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-web" target="_blank"><code>spring-boot-starter-web</code></a> &#x9ED8;&#x8BA4;&#x7684; servlet &#x5BB9;&#x5668; starter</td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-tomcat/pom.xml" target="_blank">Pom</a></td>
</tr>
<tr>
<td style="text-align:left"><code>spring-boot-starter-undertow</code></td>
<td style="text-align:left">&#x4F7F;&#x7528; Undertow &#x4F5C;&#x4E3A;&#x5D4C;&#x5165;&#x5F0F; servlet &#x5BB9;&#x5668;&#xFF0C;&#x53EF;&#x4EE3;&#x66FF; <a href="https://docs.spring.io/spring-boot/docs/2.0.0.RELEASE/reference/htmlsingle/#spring-boot-starter-tomcat" target="_blank"><code>spring-boot-starter-tomcat</code></a></td>
<td style="text-align:center"><a href="https://github.com/spring-projects/spring-boot/tree/v2.0.0.RELEASE/spring-boot-project/spring-boot-starters/spring-boot-starter-undertow/pom.xml" target="_blank">Pom</a></td>
</tr>
</tbody>
</table>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x6709;&#x5173;&#x5176;&#x5B83;&#x793E;&#x533A;&#x8D21;&#x732E;&#x7684; starter &#x5217;&#x8868;&#xFF0C;&#x8BF7;&#x53C2;&#x9605; GitHub &#x4E0A;&#x7684; <code>spring-boot-starters</code> &#x6A21;&#x5757;&#x4E2D;&#x7684; <a href="https://github.com/spring-projects/spring-boot/tree/master/spring-boot-project/spring-boot-starters/README.adoc" target="_blank">README &#x6587;&#x4EF6;</a>&#x3002;</p>
</blockquote>
<p><a id="using-boot-structuring-your-code"></a></p>
<h2 id="14&#x3001;&#x7EC4;&#x7EC7;&#x4EE3;&#x7801;">14&#x3001;&#x7EC4;&#x7EC7;&#x4EE3;&#x7801;</h2>
<p>Spring Boot &#x4E0D;&#x9700;&#x8981;&#x4EFB;&#x4F55;&#x7279;&#x5B9A;&#x7684;&#x4EE3;&#x7801;&#x5E03;&#x5C40;&#xFF0C;&#x4F46;&#x662F;&#x6709;&#x4E00;&#x4E9B;&#x6700;&#x4F73;&#x5B9E;&#x8DF5;&#x662F;&#x5F88;&#x6709;&#x7528;&#x7684;&#x3002;</p>
<p><a id="using-boot-using-the-default-package"></a></p>
<h3 id="141&#x3001;&#x4F7F;&#x7528;-default-&#x5305;">14.1&#x3001;&#x4F7F;&#x7528; default &#x5305;</h3>
<p>&#x5F53;&#x4E00;&#x4E2A;&#x7C7B;&#x6CA1;&#x6709; <code>package</code> &#x58F0;&#x660E;&#x65F6;&#xFF0C;&#x5B83;&#x5C31;&#x88AB;&#x8BA4;&#x4E3A;&#x662F;&#x5728; <strong>default</strong> &#x5305;&#x4E2D;&#x3002;&#x901A;&#x5E38;&#x4E0D;&#x9F13;&#x52B1;&#x4F7F;&#x7528; <strong>default &#x5305;</strong>&#xFF0C;&#x5E94;&#x8BE5;&#x907F;&#x514D;&#x4F7F;&#x7528;&#x3002;&#x5BF9;&#x4E8E;&#x4F7F;&#x7528; <code>@ComponentScan</code>&#x3001;<code>@EntityScan</code> &#x6216;&#x8005; <code>@SpringBootApplication</code> &#x6CE8;&#x89E3;&#x7684; Spring Boot &#x5E94;&#x7528;&#xFF0C;&#x8FD9;&#x6837;&#x53EF;&#x80FD;&#x4F1A;&#x5BFC;&#x81F4;&#x7279;&#x6B8A;&#x95EE;&#x9898;&#x53D1;&#x751F;&#xFF0C;&#x56E0;&#x4E3A;&#x6BCF;&#x4E00;&#x4E2A; jar &#x4E2D;&#x7684;&#x6BCF;&#x4E00;&#x4E2A;&#x7C7B;&#x5C06;&#x4F1A;&#x88AB;&#x8BFB;&#x53D6;&#x5230;&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x6211;&#x4EEC;&#x5EFA;&#x8BAE;&#x60A8;&#x4F7F;&#x7528; Java &#x63A8;&#x8350;&#x7684;&#x5305;&#x547D;&#x540D;&#x7EA6;&#x5B9A;&#xFF0C;&#x5E76;&#x4F7F;&#x7528;&#x57DF;&#x540D;&#x7684;&#x53CD;&#x5411;&#x5F62;&#x5F0F;&#x547D;&#x540D;&#xFF08;&#x4F8B;&#x5982;  <code>com.example.project</code>&#xFF09;&#x3002;</p>
</blockquote>
<p><a id="using-boot-locating-the-main-class"></a></p>
<h3 id="142&#x3001;&#x5B9A;&#x4F4D;&#x4E3B;&#x5E94;&#x7528;&#x7C7B;">14.2&#x3001;&#x5B9A;&#x4F4D;&#x4E3B;&#x5E94;&#x7528;&#x7C7B;</h3>
<p>&#x6211;&#x4EEC;&#x901A;&#x5E38;&#x5EFA;&#x8BAE;&#x60A8;&#x5C06;&#x4E3B;&#x5E94;&#x7528;&#x7C7B;&#x653E;&#x5728;&#x5176;&#x5B83;&#x7C7B;&#x4E4B;&#x4E0A;&#x7684;&#x6839;&#x5305;&#x4E2D;&#xFF0C; <code>@EnableAutoConfiguration</code> &#x6CE8;&#x89E3;&#x901A;&#x5E38;&#x653E;&#x5728;&#x4E3B;&#x7C7B;&#x4E0A;&#xFF0C;&#x5B83;&#x9690;&#x5F0F;&#x5B9A;&#x4E49;&#x4E86;&#x67D0;&#x4E9B;&#x9879;&#x76EE;&#x7684; <strong>&#x5305;&#x641C;&#x7D22;</strong>&#x7684;&#x57FA;&#x51C6;&#x8D77;&#x70B9;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x5728;&#x7F16;&#x5199;&#x4E00;&#x4E2A; JPA &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#xFF0C;&#x5219;&#x88AB; <code>@EnableAutoConfiguration</code> &#x6CE8;&#x89E3;&#x7684;&#x7C7B;&#x6240;&#x5C5E;&#x7684;&#x5305;&#x5C06;&#x88AB;&#x7528;&#x4E8E;&#x641C;&#x7D22;&#x6807;&#x8BB0;&#x6709; <code>@Entity</code> &#x6CE8;&#x89E3;&#x7684;&#x7C7B;&#x3002;</p>
<p>&#x4F7F;&#x7528;&#x6839;&#x5305;&#x8FD8;&#x53EF;&#x4EE5;&#x5141;&#x8BB8;&#x4F7F;&#x7528;&#x6CA1;&#x6709;&#x6307;&#x5B9A; <code>basePackage</code> &#x5C5E;&#x6027;&#x7684; <code>@ComponentScan</code> &#x6CE8;&#x89E3;&#x3002;&#x5982;&#x679C;&#x60A8;&#x7684;&#x4E3B;&#x7C7B;&#x5728;&#x6839;&#x5305;&#x4E2D;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>@SpringBootApplication</code> &#x6CE8;&#x89E3;&#x3002;</p>
<p>&#x4EE5;&#x4E0B;&#x662F;&#x4E00;&#x4E2A;&#x7ECF;&#x5178;&#x7684;&#x5305;&#x7ED3;&#x6784;&#xFF1A;</p>
<pre class="language-"><code>com
 +- example
     +- myapplication
         +- Application.java
         |
         +- customer
         |   +- Customer.java
         |   +- CustomerController.java
         |   +- CustomerService.java
         |   +- CustomerRepository.java
         |
         +- order
             +- Order.java
             +- OrderController.java
             +- OrderService.java
             +- OrderRepository.java
</code></pre><p><code>Application.java</code> &#x6587;&#x4EF6;&#x58F0;&#x660E;&#x4E86; <code>main</code> &#x65B9;&#x6CD5;&#xFF0C;&#x9644;&#x5E26;&#x4E86; <code>@Configuration</code> &#x6CE8;&#x89E3;&#x3002;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>example<span class="token punctuation">.</span>myapplication</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot</span><span class="token punctuation">.</span><span class="token class-name">SpringApplication</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token punctuation">.</span>autoconfigure</span><span class="token punctuation">.</span><span class="token class-name">EnableAutoConfiguration</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>annotation</span><span class="token punctuation">.</span><span class="token class-name">ComponentScan</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>annotation</span><span class="token punctuation">.</span><span class="token class-name">Configuration</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Configuration</span>
<span class="token annotation punctuation">@EnableAutoConfiguration</span>
<span class="token annotation punctuation">@ComponentScan</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Application</span> <span class="token punctuation">{</span>

    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">SpringApplication</span><span class="token punctuation">.</span><span class="token function">run</span><span class="token punctuation">(</span><span class="token class-name">Application</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

<span class="token punctuation">}</span>
</code></pre>
<p><a id="using-boot-configuration-classes"></a></p>
<h2 id="15&#x3001;&#x914D;&#x7F6E;&#x7C7B;">15&#x3001;&#x914D;&#x7F6E;&#x7C7B;</h2>
<p>Spring Boot &#x652F;&#x6301;&#x57FA;&#x4E8E; Java &#x7684;&#x914D;&#x7F6E;&#x3002;&#x867D;&#x7136;&#x53EF;&#x4EE5;&#x5728; <code>SpringApplication</code> &#x4E2D;&#x4F7F;&#x7528; XML &#x914D;&#x7F6E;&#x6E90;&#xFF0C;&#x4F46;&#x6211;&#x4EEC;&#x901A;&#x5E38;&#x5EFA;&#x8BAE;&#x4E3B;&#x914D;&#x7F6E;&#x6E90;&#x4E3A; <code>@Configuration</code> &#x7C7B;&#x3002;&#x901A;&#x5E38;&#xFF0C;&#x4E00;&#x4E2A;&#x5F88;&#x597D;&#x7684;&#x9009;&#x62E9;&#x662F;&#x5C06;&#x5B9A;&#x4E49;&#x4E86; <code>main</code> &#x65B9;&#x6CD5;&#x7684;&#x7C7B;&#x4F5C;&#x4E3A; <code>@Configuration</code>&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x8BB8;&#x591A; Spring &#x7684; XML &#x914D;&#x7F6E;&#x793A;&#x4F8B;&#x5DF2;&#x7ECF;&#x5728; Internet &#x4E0A;&#x53D1;&#x5E03;&#x4E86;&#x3002;&#x5982;&#x679C;&#x53EF;&#x80FD;&#x7684;&#x8BDD;&#xFF0C;&#x60A8;&#x65E0;&#x8BBA;&#x5982;&#x4F55;&#x90FD;&#x5E94;&#x8BE5;&#x5C1D;&#x8BD5;&#x7740;&#x4F7F;&#x7528;&#x7B49;&#x6548;&#x7684;&#x57FA;&#x4E8E; Java &#x7684;&#x914D;&#x7F6E;&#x65B9;&#x5F0F;&#xFF0C;&#x641C;&#x7D22; <code>Enable*</code> &#x6CE8;&#x89E3;&#x53EF;&#x4EE5;&#x5E2E;&#x5230;&#x60A8;&#x4E0D;&#x5C11;&#x5FD9;&#x3002;</p>
</blockquote>
<p><a id="using-boot-importing-configuration"></a></p>
<h3 id="151&#x3001;&#x5BFC;&#x5165;&#x989D;&#x5916;&#x7684;&#x914D;&#x7F6E;&#x7C7B;">15.1&#x3001;&#x5BFC;&#x5165;&#x989D;&#x5916;&#x7684;&#x914D;&#x7F6E;&#x7C7B;</h3>
<p>&#x4F60;&#x4E0D;&#x9700;&#x8981;&#x628A;&#x6240;&#x6709;&#x7684; <code>@Configuration</code> &#x653E;&#x5728;&#x4E00;&#x4E2A;&#x7C7B;&#x4E2D;&#x3002;<code>@Import</code> &#x6CE8;&#x89E3;&#x53EF;&#x7528;&#x4E8E;&#x5BFC;&#x5165;&#x5176;&#x4ED6;&#x914D;&#x7F6E;&#x7C7B;&#x3002;&#x6216;&#x8005;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>@ComponentScan</code> &#x81EA;&#x52A8;&#x626B;&#x63CF;&#x6240;&#x6709; Spring &#x7EC4;&#x4EF6;&#xFF0C;&#x5305;&#x62EC; <code>@Configuration</code> &#x7C7B;&#x3002;</p>
<p><a id="using-boot-importing-xml-configuration"></a></p>
<h3 id="152&#x3001;&#x5BFC;&#x5165;-xml-&#x914D;&#x7F6E;">15.2&#x3001;&#x5BFC;&#x5165; XML &#x914D;&#x7F6E;</h3>
<p>&#x5982;&#x679C;&#x60A8;&#x4E00;&#x5B9A;&#x8981;&#x4F7F;&#x7528;&#x57FA;&#x4E8E; XML &#x7684;&#x914D;&#x7F6E;&#xFF0C;&#x6211;&#x4EEC;&#x5EFA;&#x8BAE;&#x60A8;&#x4ECD;&#x7136;&#x4F7F;&#x7528; <code>@Configuration</code> &#x7C7B;&#x3002;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>@ImportResource</code> &#x6CE8;&#x89E3;&#x6765;&#x52A0;&#x8F7D; XML &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x3002;</p>
<p><a id="using-boot-auto-configuration"></a></p>
<h2 id="16&#x3001;&#x81EA;&#x52A8;&#x914D;&#x7F6E;">16&#x3001;&#x81EA;&#x52A8;&#x914D;&#x7F6E;</h2>
<p>Spring Boot &#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x5C1D;&#x8BD5;&#x6839;&#x636E;&#x60A8;&#x6DFB;&#x52A0;&#x7684; jar &#x4F9D;&#x8D56;&#x81EA;&#x52A8;&#x914D;&#x7F6E; Spring &#x5E94;&#x7528;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x5982;&#x679C; classpath &#x4E0B;&#x5B58;&#x5728; HSQLDB&#xFF0C;&#x5E76;&#x4E14;&#x60A8;&#x6CA1;&#x6709;&#x624B;&#x52A8;&#x914D;&#x7F6E;&#x4EFB;&#x4F55;&#x6570;&#x636E;&#x5E93;&#x8FDE;&#x63A5; bean&#xFF0C;&#x90A3;&#x4E48; Spring Boot &#x5C06;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x4E00;&#x4E2A;&#x5185;&#x5B58;&#x6570;&#x636E;&#x5E93;&#x3002;</p>
<p>&#x60A8;&#x9700;&#x8981;&#x901A;&#x8FC7;&#x5C06; <code>@EnableAutoConfiguration</code> &#x6216;&#x8005; <code>@SpringBootApplication</code> &#x6CE8;&#x89E3;&#x6DFB;&#x52A0;&#x5230;&#x5176;&#x4E2D;&#x4E00;&#x4E2A; <code>@Configuration</code> &#x7C7B;&#x4E4B;&#x4E0A;&#x4EE5;&#x542F;&#x7528;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x60A8;&#x5E94;&#x8BE5;&#x4EC5;&#x6DFB;&#x52A0;&#x4E00;&#x4E2A; <code>@EnableAutoConfiguration</code> &#x6CE8;&#x89E3;&#x3002;&#x6211;&#x4EEC;&#x901A;&#x5E38;&#x5EFA;&#x8BAE;&#x60A8;&#x5C06;&#x5176;&#x6DFB;&#x52A0;&#x5230;&#x4E3B; <code>@Configuration</code> &#x7C7B;&#x4E2D;&#x3002;</p>
</blockquote>
<p><a id="using-boot-replacing-auto-configuration"></a></p>
<h3 id="161&#x3001;&#x5E73;&#x6ED1;&#x66FF;&#x6362;&#x81EA;&#x52A8;&#x914D;&#x7F6E;">16.1&#x3001;&#x5E73;&#x6ED1;&#x66FF;&#x6362;&#x81EA;&#x52A8;&#x914D;&#x7F6E;</h3>
<p>&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x662F;&#x975E;&#x5165;&#x4FB5;&#x7684;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x968F;&#x65F6;&#x5B9A;&#x4E49;&#x81EA;&#x5DF1;&#x7684;&#x914D;&#x7F6E;&#x6765;&#x4EE3;&#x66FF;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x7684;&#x7279;&#x5B9A;&#x90E8;&#x5206;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x6DFB;&#x52A0;&#x4E86;&#x81EA;&#x5DF1;&#x7684; <code>DataSource</code> bean&#xFF0C;&#x9ED8;&#x8BA4;&#x7684;&#x5D4C;&#x5165;&#x5F0F;&#x6570;&#x636E;&#x5E93;&#x652F;&#x6301;&#x5C06;&#x4E0D;&#x4F1A;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x9700;&#x8981;&#x4E86;&#x89E3;&#x5F53;&#x524D;&#x6B63;&#x5728;&#x5E94;&#x7528;&#x7684;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#xFF0C;&#x4EE5;&#x53CA;&#x4E3A;&#x4EC0;&#x4E48;&#x4F7F;&#x7528;&#xFF0C;&#x8BF7;&#x4F7F;&#x7528; <code>--debug</code> &#x5F00;&#x5173;&#x542F;&#x52A8;&#x5E94;&#x7528;&#x3002;&#x8FD9;&#x6837;&#x505A;&#x53EF;&#x4EE5;&#x4E3A;&#x6838;&#x5FC3; logger &#x542F;&#x7528;&#x8C03;&#x8BD5;&#x65E5;&#x5FD7;&#xFF0C;&#x5E76;&#x8BB0;&#x5F55;&#x5230;&#x63A7;&#x5236;&#x53F0;&#x3002;</p>
<p><a id="using-boot-disabling-specific-auto-configuration"></a></p>
<h3 id="162&#x3001;&#x7981;&#x7528;&#x6307;&#x5B9A;&#x7684;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x7C7B;">16.2&#x3001;&#x7981;&#x7528;&#x6307;&#x5B9A;&#x7684;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x7C7B;</h3>
<p>&#x5982;&#x679C;&#x60A8;&#x53D1;&#x73B0;&#x5728;&#x6B63;&#x5728;&#x4F7F;&#x7528;&#x4E0D;&#x9700;&#x8981;&#x7684;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x7C7B;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4F7F;&#x7528; <code>@EnableAutoConfiguration</code> &#x7684; <code>exclude</code> &#x5C5E;&#x6027;&#x6765;&#x7981;&#x7528;&#x5B83;&#x4EEC;&#x3002;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token punctuation">.</span>autoconfigure</span><span class="token punctuation">.</span>*<span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token punctuation">.</span>autoconfigure<span class="token punctuation">.</span>jdbc</span><span class="token punctuation">.</span>*<span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>context<span class="token punctuation">.</span>annotation</span><span class="token punctuation">.</span>*<span class="token punctuation">;</span>

<span class="token annotation punctuation">@Configuration</span>
<span class="token annotation punctuation">@EnableAutoConfiguration</span><span class="token punctuation">(</span>exclude<span class="token operator">=</span><span class="token punctuation">{</span><span class="token class-name">DataSourceAutoConfiguration</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">}</span><span class="token punctuation">)</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">MyConfiguration</span> <span class="token punctuation">{</span>
<span class="token punctuation">}</span>
</code></pre>
<p>&#x5982;&#x679C;&#x7C7B;&#x4E0D;&#x5728; classpath &#x4E0B;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x6CE8;&#x89E3;&#x7684; <code>excludeName</code> &#x5C5E;&#x6027;&#x5E76;&#x6307;&#x5B9A;&#x5B8C;&#x5168;&#x7C7B;&#x540D;&#x3002;&#x6700;&#x540E;&#xFF0C;&#x60A8;&#x8FD8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; <code>spring.autoconfigure.exclude</code> property &#x63A7;&#x5236;&#x8981;&#x6392;&#x9664;&#x7684;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x7C7B;&#x5217;&#x8868;&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x60A8;&#x53EF;&#x4EE5;&#x540C;&#x65F6;&#x4F7F;&#x7528;&#x6CE8;&#x89E3;&#x548C; property &#x5B9A;&#x4E49;&#x6392;&#x9664;&#x9879;</p>
</blockquote>
<p><a id="using-boot-spring-beans-and-dependency-injection"></a></p>
<h2 id="17&#x3001;spring-bean-&#x4E0E;&#x4F9D;&#x8D56;&#x6CE8;&#x5165;">17&#x3001;Spring Bean &#x4E0E;&#x4F9D;&#x8D56;&#x6CE8;&#x5165;</h2>
<p>&#x60A8;&#x53EF;&#x4EE5;&#x81EA;&#x7531;&#x4F7F;&#x7528;&#x4EFB;&#x4F55;&#x6807;&#x51C6;&#x7684; Spring Framework &#x6280;&#x672F;&#x6765;&#x5B9A;&#x4E49;&#x60A8;&#x7684; bean &#x4EE5;&#x53CA;&#x5B83;&#x4EEC;&#x6CE8;&#x5165;&#x7684;&#x4F9D;&#x8D56;&#x3002;&#x6211;&#x4EEC;&#x53D1;&#x73B0;&#x4F7F;&#x7528; <code>@ComponentScan</code> &#x6765;&#x5BFB;&#x627E; bean &#x548C;&#x7ED3;&#x5408; <code>@Autowired</code> &#x6784;&#x9020;&#x5668;&#x6CE8;&#x5165;&#x53EF;&#x4EE5;&#x5F88;&#x597D;&#x5730;&#x5DE5;&#x4F5C;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x6309;&#x7167;&#x4E0A;&#x8FF0;&#x7684;&#x5EFA;&#x8BAE;&#xFF08;&#x5C06;&#x5E94;&#x7528;&#x7C7B;&#x653E;&#x5728;&#x6839;&#x5305;&#x4E2D;&#xFF09;&#x6765;&#x7EC4;&#x7EC7;&#x4EE3;&#x7801;&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x6DFB;&#x52A0;&#x65E0;&#x53C2;&#x7684; <code>@ComponentScan</code>&#x3002;&#x6240;&#x6709;&#x5E94;&#x7528;&#x7EC4;&#x4EF6;&#xFF08;<code>@Component</code>&#x3001;<code>@Service</code>&#x3001;<code>@Repository</code>&#x3001;<code>@Controller</code> &#x7B49;&#xFF09;&#x5C06;&#x81EA;&#x52A8;&#x6CE8;&#x518C;&#x4E3A; Spring Bean&#x3002;</p>
<p>&#x4EE5;&#x4E0B;&#x662F;&#x4E00;&#x4E2A; <code>@Service</code> Bean&#xFF0C;&#x5176;&#x4F7F;&#x7528;&#x6784;&#x9020;&#x6CE8;&#x5165;&#x65B9;&#x5F0F;&#x83B7;&#x53D6;&#x4E00;&#x4E2A;&#x5FC5;&#x9700;&#x7684; <code>RiskAssessor</code> bean&#x3002;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>example<span class="token punctuation">.</span>service</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>beans<span class="token punctuation">.</span>factory<span class="token punctuation">.</span>annotation</span><span class="token punctuation">.</span><span class="token class-name">Autowired</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>stereotype</span><span class="token punctuation">.</span><span class="token class-name">Service</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@Service</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">DatabaseAccountService</span> <span class="token keyword">implements</span> <span class="token class-name">AccountService</span> <span class="token punctuation">{</span>

    <span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">RiskAssessor</span> riskAssessor<span class="token punctuation">;</span>

    <span class="token annotation punctuation">@Autowired</span>
    <span class="token keyword">public</span> <span class="token class-name">DatabaseAccountService</span><span class="token punctuation">(</span><span class="token class-name">RiskAssessor</span> riskAssessor<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>riskAssessor <span class="token operator">=</span> riskAssessor<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">// ...</span>

<span class="token punctuation">}</span>
</code></pre>
<p>&#x5982;&#x679C; bean &#x4E2D;&#x53EA;&#x6709;&#x4E00;&#x4E2A;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x5FFD;&#x7565;&#x6389; <code>@Autowired</code> &#x6CE8;&#x89E3;&#x3002;</p>
<pre class="language-"><code class="lang-java"><span class="token annotation punctuation">@Service</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">DatabaseAccountService</span> <span class="token keyword">implements</span> <span class="token class-name">AccountService</span> <span class="token punctuation">{</span>

    <span class="token keyword">private</span> <span class="token keyword">final</span> <span class="token class-name">RiskAssessor</span> riskAssessor<span class="token punctuation">;</span>

    <span class="token keyword">public</span> <span class="token class-name">DatabaseAccountService</span><span class="token punctuation">(</span><span class="token class-name">RiskAssessor</span> riskAssessor<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token keyword">this</span><span class="token punctuation">.</span>riskAssessor <span class="token operator">=</span> riskAssessor<span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

    <span class="token comment">// ...</span>

<span class="token punctuation">}</span>
</code></pre>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x6784;&#x9020;&#x6CE8;&#x5165;&#x5141;&#x8BB8; <code>riskAssessor</code> &#x5B57;&#x6BB5;&#x88AB;&#x4FEE;&#x9970;&#x4E3A; <code>final</code>&#xFF0C;&#x8FD9;&#x8868;&#x793A;&#x4EE5;&#x540E;&#x5B83;&#x4E0D;&#x80FD;&#x88AB;&#x66F4;&#x6539;&#x3002;</p>
</blockquote>
<p><a id="using-boot-using-springbootapplication-annotation"></a></p>
<h2 id="18&#x3001;&#x4F7F;&#x7528;-springbootapplication-&#x6CE8;&#x89E3;">18&#x3001;&#x4F7F;&#x7528; @SpringBootApplication &#x6CE8;&#x89E3;</h2>
<p>&#x5F88;&#x591A; Spring Boot &#x5F00;&#x53D1;&#x8005;&#x603B;&#x662F;&#x4F7F;&#x7528; <code>@Configuration</code>&#x3001;<code>@EnableAutoConfiguration</code> &#x548C; <code>@ComponentScan</code> &#x6CE8;&#x89E3;&#x6807;&#x8BB0;&#x5728;&#x4E3B;&#x7C7B;&#x4E0A;&#x3002;&#x7531;&#x4E8E; &#x8FD9;&#x4E9B;&#x6CE8;&#x89E3;&#x7ECF;&#x5E38;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#xFF08;&#x7279;&#x522B;&#x662F;&#x5982;&#x679C;&#x60A8;&#x9075;&#x5FAA;&#x4E0A;&#x8FF0;&#x7684;<a href="#using-boot-structuring-your-code">&#x6700;&#x4F73;&#x5B9E;&#x8DF5;</a>&#xFF09;&#x3002;Spring Boot &#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x66F4;&#x65B9;&#x4FBF;&#x7684; <code>@SpringBootApplication</code> &#x6CE8;&#x89E3;&#x53EF;&#x7528;&#x6765;&#x66FF;&#x4EE3;&#x8FD9;&#x4E2A;&#x7EC4;&#x5408;&#x3002;</p>
<p><code>@SpringBootApplication</code> &#x6CE8;&#x89E3;&#x76F8;&#x5F53;&#x4E8E;&#x4F7F;&#x7528; <code>@Configuration</code>&#x3001;<code>@EnableAutoConfiguration</code> &#x548C; <code>@ComponentScan</code> &#x53CA;&#x4ED6;&#x4EEC;&#x7684;&#x9ED8;&#x8BA4;&#x5C5E;&#x6027;&#xFF1A;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">package</span> <span class="token namespace">com<span class="token punctuation">.</span>example<span class="token punctuation">.</span>myapplication</span><span class="token punctuation">;</span>

<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot</span><span class="token punctuation">.</span><span class="token class-name">SpringApplication</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token namespace">org<span class="token punctuation">.</span>springframework<span class="token punctuation">.</span>boot<span class="token punctuation">.</span>autoconfigure</span><span class="token punctuation">.</span><span class="token class-name">SpringBootApplication</span><span class="token punctuation">;</span>

<span class="token annotation punctuation">@SpringBootApplication</span> <span class="token comment">// &#x76F8;&#x5F53;&#x4E8E;&#x4F7F;&#x7528; @Configuration @EnableAutoConfiguration @ComponentScan</span>
<span class="token keyword">public</span> <span class="token keyword">class</span> <span class="token class-name">Application</span> <span class="token punctuation">{</span>

    <span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
        <span class="token class-name">SpringApplication</span><span class="token punctuation">.</span><span class="token function">run</span><span class="token punctuation">(</span><span class="token class-name">Application</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token punctuation">}</span>

<span class="token punctuation">}</span>
</code></pre>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p><code>@SpringBootApplication</code> &#x8FD8;&#x63D0;&#x4F9B;&#x4E86;&#x522B;&#x540D;&#x6765;&#x81EA;&#x5B9A;&#x4E49; <code>@EnableAutoConfiguration</code> &#x548C; <code>@ComponentScan</code> &#x7684;&#x5C5E;&#x6027;&#x3002;</p>
</blockquote>
<p><a id="using-boot-running-your-application"></a></p>
<h2 id="19&#x3001;&#x8FD0;&#x884C;&#x60A8;&#x7684;&#x5E94;&#x7528;">19&#x3001;&#x8FD0;&#x884C;&#x60A8;&#x7684;&#x5E94;&#x7528;</h2>
<p>&#x5C06;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x6253;&#x5305;&#x6210; <code>jar</code> &#x53EF;&#x6267;&#x884C;&#x6587;&#x4EF6;&#x5E76;&#x4F7F;&#x7528;&#x5D4C;&#x5165;&#x5F0F; HTTP &#x670D;&#x52A1;&#x5668;&#x7684;&#x6700;&#x5927;&#x6709;&#x70B9;&#x4E4B;&#x4E00;&#x5C31;&#x662F;&#x53EF;&#x4EE5;&#x6309;&#x7167;&#x60A8;&#x60F3;&#x4F7F;&#x7528;&#x7684;&#x5176;&#x5B83;&#x65B9;&#x5F0F;&#x6765;&#x8FD0;&#x884C;&#x5E94;&#x7528;&#x3002;&#x8C03;&#x8BD5; Spring Boot &#x4E5F;&#x662F;&#x5F88;&#x7B80;&#x5355;&#xFF0C;&#x60A8;&#x4E0D;&#x9700;&#x8981;&#x4EFB;&#x4F55;&#x7279;&#x6B8A;&#x7684; IDE &#x63D2;&#x4EF6;&#x6216;&#x8005;&#x6269;&#x5C55;&#x3002;</p>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x672C;&#x7AE0;&#x8282;&#x4EC5;&#x6DB5;&#x76D6;&#x57FA;&#x4E8E;&#x3000;jar&#x3000;&#x7684;&#x6253;&#x5305;&#x65B9;&#x5F0F;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x9009;&#x62E9;&#x5C06;&#x5E94;&#x7528;&#x6253;&#x5305;&#x4E3A;&#x3000;war&#x3000;&#x6587;&#x4EF6;&#xFF0C;&#x5219;&#x5E94;&#x8BE5;&#x53C2;&#x8003;&#x60A8;&#x7684;&#x670D;&#x52A1;&#x5668;&#x548C;&#x3000;IDE&#x3000;&#x6587;&#x6863;&#x3002;</p>
</blockquote>
<p><a id="using-boot-running-your-application"></a></p>
<h3 id="191&#x3001;&#x4F7F;&#x7528;-ide-&#x8FD0;&#x884C;">19.1&#x3001;&#x4F7F;&#x7528; IDE &#x8FD0;&#x884C;</h3>
<p>&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; IDE &#x8FD0;&#x884C; Spring Boot&#x5E94;&#x7528;&#xFF0C;&#x5C31;&#x50CF;&#x8FD0;&#x884C;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684; Java &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x4E00;&#x6837;&#xFF0C;&#x4F46;&#x662F;&#x9996;&#x5148;&#x60A8;&#x9700;&#x8981;&#x5BFC;&#x5165;&#x9879;&#x76EE;&#xFF0C;&#x5BFC;&#x5165;&#x6B65;&#x9AA4;&#x53D6;&#x51B3;&#x4E8E;&#x60A8;&#x7684; IDE &#x548C;&#x6784;&#x5EFA;&#x7CFB;&#x7EDF;&#x3002;&#x5927;&#x591A;&#x6570; IDE &#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x5BFC;&#x5165; Maven &#x9879;&#x76EE;&#xFF0C;&#x4F8B;&#x5982; Eclipse &#x7528;&#x6237;&#x53EF;&#x4EE5;&#x4ECE; <code>File</code> &#x83DC;&#x5355;&#x4E2D;&#x9009;&#x62E9; <code>Import</code> &#x200B; &#x2192; <code>Existing Maven Projects</code>&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x65E0;&#x6CD5;&#x5C06;&#x9879;&#x76EE;&#x76F4;&#x63A5;&#x5BFC;&#x5165;&#x5230; IDE &#x4E2D;&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x6784;&#x5EFA;&#x63D2;&#x4EF6;&#x751F;&#x6210; IDE &#x5143;&#x6570;&#x636E;&#xFF08;metadata&#xFF09;&#x3002;Maven &#x5305;&#x542B;&#x4E86; <a href="https://maven.apache.org/plugins/maven-eclipse-plugin/" target="_blank">Eclipse</a> &#x548C; <a href="https://maven.apache.org/plugins/maven-idea-plugin/" target="_blank">IDEA</a> &#x7684;&#x63D2;&#x4EF6;,Gradle &#x4E5F;&#x4E3A;<a href="https://docs.gradle.org/4.2.1/userguide/userguide.html" target="_blank">&#x5404;&#x79CD; IDE</a> &#x63D0;&#x4F9B;&#x4E86;&#x63D2;&#x4EF6;&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x5982;&#x679C;&#x60A8;&#x4E0D;&#x5C0F;&#x5FC3;&#x8FD0;&#x884C;&#x4E86;&#x4E24;&#x6B21; web &#x5E94;&#x7528;&#xFF0C;&#x60A8;&#x5C06;&#x770B;&#x5230;&#x4E00;&#x4E2A; <strong>Port already in use</strong> &#xFF08;&#x7AEF;&#x53E3;&#x5DF2;&#x7ECF;&#x88AB;&#x4F7F;&#x7528;&#xFF09;&#x9519;&#x8BEF;&#x3002;STS &#x7528;&#x6237;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>Relaunch</code> &#x6309;&#x94AE;&#x8FD0;&#x884C;&#x4EE5;&#x786E;&#x4FDD;&#x73B0;&#x6709;&#x7684;&#x4EFB;&#x4F55;&#x5B9E;&#x4F8B;&#x90FD;&#x5DF2;&#x5173;&#x95ED;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x4F7F;&#x7528; Run &#x6309;&#x94AE;&#x3002;</p>
</blockquote>
<p><a id="using-boot-running-as-a-packaged-application"></a></p>
<h3 id="192&#x3001;&#x4F5C;&#x4E3A;&#x6253;&#x5305;&#x5E94;&#x7528;&#x8FD0;&#x884C;">19.2&#x3001;&#x4F5C;&#x4E3A;&#x6253;&#x5305;&#x5E94;&#x7528;&#x8FD0;&#x884C;</h3>
<p>&#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528; Spring Boot Maven &#x6216;&#x8005; Gradle &#x63D2;&#x4EF6;&#x521B;&#x5EFA;&#x53EF;&#x6267;&#x884C; jar&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>java -jar</code> &#x547D;&#x4EE4;&#x8FD0;&#x884C;&#x5E94;&#x7528;&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ java -jar target/myapplication-0.0.1-SNAPSHOT.jar
</code></pre>
<p>&#x4E5F;&#x53EF;&#x4EE5;&#x5728;&#x8FD0;&#x884C;&#x6253;&#x5305;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x65F6;&#x5F00;&#x542F;&#x8FDC;&#x7A0B;&#x8C03;&#x8BD5;&#x652F;&#x6301;&#x3002;&#x8BE5;&#x529F;&#x80FD;&#x5141;&#x8BB8;&#x60A8;&#x5C06;&#x8C03;&#x8BD5;&#x5668;&#x9644;&#x52A0;&#x5230;&#x6253;&#x5305;&#x7684;&#x5E94;&#x7528;&#x4E2D;&#x3002;</p>
<pre class="language-"><code class="lang-bash">$ java -Xdebug -Xrunjdwp:server<span class="token operator">=</span>y,transport<span class="token operator">=</span>dt_socket,address<span class="token operator">=</span><span class="token number">8000</span>,suspend<span class="token operator">=</span>n <span class="token punctuation">\</span>
       -jar target/myapplication-0.0.1-SNAPSHOT.jar
</code></pre>
<p><a id="using-boot-running-with-the-maven-plugin"></a></p>
<h3 id="193&#x3001;&#x4F7F;&#x7528;-maven-&#x63D2;&#x4EF6;">19.3&#x3001;&#x4F7F;&#x7528; Maven &#x63D2;&#x4EF6;</h3>
<p>Spring Boot Maven &#x63D2;&#x4EF6;&#x5305;&#x542B;&#x4E00;&#x4E2A;&#x53EF;&#x7528;&#x4E8E;&#x5FEB;&#x901F;&#x7F16;&#x8BD1;&#x548C;&#x8FD0;&#x884C;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7684; <code>run</code> goal&#x3002;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x4EE5;&#x5FEB;&#x901F;&#x5F62;&#x5F0F;&#x8FD0;&#x884C;&#xFF0C;&#x5C31;&#x50CF;&#x5728; IDE &#x4E2D;&#x4E00;&#x6837;&#x3002;&#x4EE5;&#x4E0B;&#x793A;&#x4F8B;&#x5C55;&#x793A;&#x4E86;&#x8FD0;&#x884C; Spring Boot &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7684;&#x5178;&#x578B; Maven &#x547D;&#x4EE4;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ mvn spring-boot:run
</code></pre>
<p>&#x60A8;&#x53EF;&#x80FD;&#x8FD8;&#x60F3;&#x4F7F;&#x7528; <code>MAVEN_OPTS</code> &#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#xFF0C;&#x5982;&#x4E0B;&#x4F8B;&#x6240;&#x793A;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ <span class="token builtin class-name">export</span> <span class="token assign-left variable">MAVEN_OPTS</span><span class="token operator">=</span>-Xmx1024m
</code></pre>
<p><a id="using-boot-running-with-the-gradle-plugin"></a></p>
<h3 id="194&#x3001;&#x4F7F;&#x7528;-gradle-&#x63D2;&#x4EF6;">19.4&#x3001;&#x4F7F;&#x7528; Gradle &#x63D2;&#x4EF6;</h3>
<p>Spring Boot Gradle &#x63D2;&#x4EF6;&#x5305;&#x542B;&#x4E00;&#x4E2A; <code>bootRun</code> &#x4EFB;&#x52A1;&#xFF0C;&#x53EF;&#x7528;&#x4E8E;&#x4EE5;&#x5FEB;&#x901F;&#x5F62;&#x5F0F;&#x8FD0;&#x884C;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x3002;&#x6BCF;&#x5F53;&#x5E94;&#x7528; <code>org.springframework.boot</code> &#x548C; java &#x63D2;&#x4EF6;&#x65F6;&#x90FD;&#x4F1A;&#x6DFB;&#x52A0; <code>bootRun</code> &#x4EFB;&#x52A1;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ gradle bootRun
</code></pre>
<p>&#x60A8;&#x53EF;&#x80FD;&#x8FD8;&#x60F3;&#x4F7F;&#x7528; <code>JAVA_OPTS</code> &#x64CD;&#x4F5C;&#x7CFB;&#x7EDF;&#x73AF;&#x5883;&#x53D8;&#x91CF;&#xFF1A;</p>
<pre class="language-"><code class="lang-bash">$ <span class="token builtin class-name">export</span> <span class="token assign-left variable">JAVA_OPTS</span><span class="token operator">=</span>-Xmx1024m
</code></pre>
<p><a id="using-boot-hot-swapping"></a></p>
<h3 id="195&#x3001;&#x70ED;&#x4EA4;&#x6362;">19.5&#x3001;&#x70ED;&#x4EA4;&#x6362;</h3>
<p>&#x7531;&#x4E8E; Spring Boot &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x53EA;&#x662F;&#x666E;&#x901A;&#x7684; Java &#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#xFF0C;&#x56E0;&#x6B64; JVM &#x70ED;&#x63D2;&#x62D4;&#x662F;&#x53EF;&#x4EE5;&#x5F00;&#x7BB1;&#x5373;&#x7528;&#x3002;JVM &#x70ED;&#x63D2;&#x62D4;&#x5728;&#x53EF;&#x66FF;&#x6362;&#x5B57;&#x8282;&#x7801;&#x65B9;&#x9762;&#x6709;&#x6240;&#x9650;&#x5236;&#x3002;&#x60F3;&#x8981;&#x66F4;&#x5B8C;&#x6574;&#x7684;&#x89E3;&#x51B3;&#x65B9;&#x6848;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <a href="https://zeroturnaround.com/software/jrebel/" target="_blank">JRebel</a>&#x3002;</p>
<p><code>spring-boot-devtools</code> &#x6A21;&#x5757;&#x5305;&#x542B;&#x4E86;&#x5BF9;&#x5FEB;&#x901F;&#x91CD;&#x65B0;&#x542F;&#x52A8;&#x5E94;&#x7528;&#x7A0B;&#x5E8F;&#x7684;&#x652F;&#x6301;&#x3002;&#x6709;&#x5173;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#xFF0C;&#x8BF7;&#x53C2;&#x9605;&#x672C;&#x7AE0;&#x540E;&#x9762;&#x7684;<a href="#using-boot-devtools">&#x7B2C; 20 &#x7AE0;&#xFF1A;&#x5F00;&#x53D1;&#x4EBA;&#x5458;&#x5DE5;&#x5177;</a>&#x90E8;&#x5206;&#x4EE5;&#x53CA;<a href="#howto-hotswapping">&#x70ED;&#x63D2;&#x62D4;&#x7684; How-to &#x90E8;&#x5206;</a>&#x3002;</p>
<p><a id="using-boot-devtools"></a></p>
<h2 id="20&#x3001;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;">20&#x3001;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;</h2>
<p>Spring Boot &#x5305;&#x542B;&#x4E86;&#x4E00;&#x5957;&#x5DE5;&#x5177;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x5E94;&#x7528;&#x5F00;&#x53D1;&#x4F53;&#x9A8C;&#x66F4;&#x52A0;&#x6109;&#x5FEB;&#x3002;<code>spring-boot-devtools</code> &#x6A21;&#x5757;&#x53EF;&#x5305;&#x542B;&#x5728;&#x4EFB;&#x4F55;&#x9879;&#x76EE;&#x4E2D;&#xFF0C;&#x4EE5;&#x63D0;&#x4F9B;&#x989D;&#x5916;&#x7684;&#x5F00;&#x53D1;&#x65F6;&#xFF08;development-time&#xFF09;&#x529F;&#x80FD;&#x3002;&#x8981;&#x542F;&#x7528; devtools &#x652F;&#x6301;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x5C06;&#x6A21;&#x5757;&#x4F9D;&#x8D56;&#x6DFB;&#x52A0;&#x5230;&#x60A8;&#x7684;&#x6784;&#x5EFA;&#x914D;&#x7F6E;&#x4E2D;&#x5373;&#x53EF;&#xFF1A;</p>
<p><strong>Maven</strong></p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependencies</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>dependency</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-devtools<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>optional</span><span class="token punctuation">&gt;</span></span>true<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>optional</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependency</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>dependencies</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p><strong>Gradle</strong></p>
<pre class="language-"><code class="lang-xml">dependencies {
    compile(&quot;org.springframework.boot:spring-boot-devtools&quot;)
}
</code></pre>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x5F53;&#x8FD0;&#x884C;&#x5B8C;&#x5168;&#x6253;&#x5305;&#x7684;&#x5E94;&#x7528;&#x65F6;&#xFF0C;&#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x5C06;&#x4F1A;&#x81EA;&#x52A8;&#x7981;&#x7528;&#x3002;&#x5982;&#x679C;&#x60A8;&#x7684;&#x5E94;&#x7528;&#x4F7F;&#x7528;&#x4E86; <code>java -jar</code> &#x65B9;&#x5F0F;&#x6216;&#x8005;&#x7279;&#x6B8A;&#x7684;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x542F;&#x52A8;&#xFF0C;&#x90A3;&#x4E48;&#x5B83;&#x4F1A;&#x88AB;&#x8BA4;&#x4E3A;&#x662F;&#x4E00;&#x4E2A;<strong>&#x751F;&#x4EA7;&#x7EA7;&#x522B;&#x5E94;&#x7528;</strong>&#x3002;&#x5C06; Maven &#x7684;&#x4F9D;&#x8D56;&#x6807;&#x8BB0;&#x4E3A;&#x53EF;&#x9009;&#x6216;&#x8005;&#x5728; Gradle &#x4E2D;&#x4F7F;&#x7528; <code>compileOnly</code> &#x662F;&#x9632;&#x6B62;&#x60A8;&#x7684;&#x9879;&#x76EE;&#x88AB;&#x5176;&#x4ED6;&#x6A21;&#x5757;&#x4F7F;&#x7528;&#x65F6; devtools &#x88AB;&#x5E94;&#x7528;&#x5230;&#x5176;&#x5B83;&#x6A21;&#x5757;&#x7684;&#x6700;&#x4F73;&#x65B9;&#x6CD5;&#x3002;</p>
</blockquote>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x91CD;&#x65B0;&#x6253;&#x5305;&#x7684;&#x5F52;&#x6863;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#x4E0D;&#x5305;&#x542B; devtools&#x3002;&#x5982;&#x679C;&#x8981;&#x4F7F;&#x7528;<a href="#using-boot-devtools-remote">&#x67D0;&#x4E9B;&#x8FDC;&#x7A0B; devtools &#x529F;&#x80FD;</a>, &#x4F60;&#x9700;&#x8981;&#x7981;&#x7528; <code>excludeDevtools</code> &#x6784;&#x5EFA;&#x5C5E;&#x6027;&#x4EE5;&#x628A; devtools &#x5305;&#x542B;&#x8FDB;&#x6765;&#x3002;&#x8BE5;&#x5C5E;&#x6027;&#x652F;&#x6301; Maven &#x548C; Gradle &#x63D2;&#x4EF6;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-property-defaults"></a></p>
<h3 id="201&#x3001;property-&#x9ED8;&#x8BA4;&#x503C;">20.1&#x3001;Property &#x9ED8;&#x8BA4;&#x503C;</h3>
<p>Spring Boot &#x6240;&#x652F;&#x6301;&#x7684;&#x4E00;&#x4E9B;&#x5E93;&#x4F7F;&#x7528;&#x4E86;&#x7F13;&#x5B58;&#x6765;&#x63D0;&#x9AD8;&#x6027;&#x80FD;&#x3002;&#x4F8B;&#x5982;&#xFF0C;<a href="#boot-features-spring-mvc-template-engines">&#x6A21;&#x677F;&#x5F15;&#x64CE;</a>&#x5C06;&#x7F13;&#x5B58;&#x7F16;&#x8BD1;&#x540E;&#x7684;&#x6A21;&#x677F;&#xFF0C;&#x4EE5;&#x907F;&#x514D;&#x91CD;&#x590D;&#x89E3;&#x6790;&#x6A21;&#x677F;&#x6587;&#x4EF6;&#x3002;&#x6B64;&#x5916;&#xFF0C;Spring MVC &#x53EF;&#x4EE5;&#x5728;&#x670D;&#x52A1;&#x9759;&#x6001;&#x8D44;&#x6E90;&#x65F6;&#x6DFB;&#x52A0; HTTP &#x7F13;&#x5B58;&#x5934;&#x3002;</p>
<p>&#x867D;&#x7136;&#x7F13;&#x5B58;&#x5728;&#x751F;&#x4EA7;&#x4E2D;&#x975E;&#x5E38;&#x6709;&#x7528;&#xFF0C;&#x4F46;&#x5B83;&#x5728;&#x5F00;&#x53D1;&#x8FC7;&#x7A0B;&#x53EF;&#x80FD;&#x4F1A;&#x4EA7;&#x751F;&#x76F8;&#x53CD;&#x7684;&#x6548;&#x679C;&#xFF0C;&#x8BA9;&#x60A8;&#x4E0D;&#x80FD;&#x53CA;&#x65F6;&#x770B;&#x5230;&#x521A;&#x624D;&#x5728;&#x5E94;&#x7528;&#x4E2D;&#x4F5C;&#x51FA;&#x7684;&#x66F4;&#x6539;&#x3002;&#x56E0;&#x6B64;&#xFF0C;<code>spring-boot-devtools</code> &#x5C06;&#x9ED8;&#x8BA4;&#x7981;&#x7528;&#x8FD9;&#x4E9B;&#x7F13;&#x5B58;&#x9009;&#x9879;&#x3002;</p>
<p>&#x4E00;&#x822C;&#x662F;&#x5728; <code>application.properties</code> &#x6587;&#x4EF6;&#x4E2D;&#x8BBE;&#x7F6E;&#x7F13;&#x5B58;&#x9009;&#x9879;&#x3002;&#x4F8B;&#x5982;&#xFF0C;Thymeleaf &#x63D0;&#x4F9B;&#x4E86; <code>spring.thymeleaf.cache</code> &#x5C5E;&#x6027;&#x3002;&#x60A8;&#x4E0D;&#x9700;&#x8981;&#x624B;&#x52A8;&#x8BBE;&#x7F6E;&#x8FD9;&#x4E9B;&#x5C5E;&#x6027;&#xFF0C;<code>spring-boot-devtools</code> &#x4F1A;&#x81EA;&#x52A8;&#x5E94;&#x7528;&#x5408;&#x9002;&#x7684;&#x5F00;&#x53D1;&#x65F6;&#xFF08;development-time&#xFF09;&#x914D;&#x7F6E;&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x6709;&#x5173;&#x5E94;&#x7528;&#x5C5E;&#x6027;&#x7684;&#x5B8C;&#x6574;&#x5217;&#x8868;&#xFF0C;&#x8BF7;&#x53C2;&#x9605; <a href="https://github.com/spring-projects/spring-boot/tree/v2.0.1.RELEASE/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/env/DevToolsPropertyDefaultsPostProcessor.java" target="_blank">DevToolsPropertyDefaultsPostProcessor</a>&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-restart"></a></p>
<h3 id="202&#x3001;&#x81EA;&#x52A8;&#x91CD;&#x542F;">20.2&#x3001;&#x81EA;&#x52A8;&#x91CD;&#x542F;</h3>
<p>&#x4F7F;&#x7528; <code>spring-boot-devtools</code> &#x7684;&#x5E94;&#x7528;&#x5728; classpath &#x4E0B;&#x7684;&#x6587;&#x4EF6;&#x53D1;&#x751F;&#x66F4;&#x6539;&#x65F6;&#x4F1A;&#x81EA;&#x52A8;&#x91CD;&#x542F;&#x3002;&#x8FD9;&#x5BF9;&#x4E8E;&#x4F7F;&#x7528; IDE &#x5DE5;&#x4F5C;&#x800C;&#x8A00;&#x53EF;&#x80FD;&#x662F;&#x4E00;&#x4E2A;&#x975E;&#x5E38;&#x68D2;&#x7684;&#x529F;&#x80FD;&#xFF0C;&#x56E0;&#x4E3A;&#x5B83;&#x4E3A;&#x4EE3;&#x7801;&#x53D8;&#x66F4;&#x63D0;&#x4F9B;&#x4E86;&#x975E;&#x5E38;&#x5757;&#x7684;&#x53CD;&#x9988;&#x73AF;&#x3002;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5C06;&#x76D1;&#x89C6; classpath &#x6307;&#x5411;&#x7684;&#x6240;&#x6709;&#x6587;&#x4EF6;&#x5939;&#x3002;&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x67D0;&#x4E9B;&#x8D44;&#x6E90;&#xFF08;&#x5982;&#x9759;&#x6001;&#x8D44;&#x6E90;&#x548C;&#x89C6;&#x56FE;&#x6A21;&#x677F;&#xFF09;<a href="using-boot-devtools-restart-exclude">&#x4E0D;&#x9700;&#x8981;&#x91CD;&#x542F;&#x5E94;&#x7528;</a>&#x3002;</p>
<hr>
<p><strong>&#x89E6;&#x53D1;&#x91CD;&#x542F;</strong></p>
<p>&#x5F53; DevTools &#x76D1;&#x89C6; classpath &#x8D44;&#x6E90;&#x65F6;&#xFF0C;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x7684;&#x552F;&#x4E00;&#x65B9;&#x5F0F;&#x662F;&#x66F4;&#x65B0; classpath&#x3002;&#x4F7F; classpath &#x66F4;&#x65B0;&#x7684;&#x65B9;&#x5F0F;&#x53D6;&#x51B3;&#x4E8E;&#x60A8;&#x4F7F;&#x7528;&#x7684; IDE&#x3002;&#x5728; Eclipse &#x4E2D;&#xFF0C;&#x4FDD;&#x5B58;&#x4FEE;&#x6539;&#x7684;&#x6587;&#x4EF6;&#x5C06;&#x66F4;&#x65B0; classpath&#xFF0C;&#x4ECE;&#x800C;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x3002;&#x5728; IntelliJ IDEA &#x4E2D;&#xFF0C;&#x6784;&#x5EFA;&#x9879;&#x76EE;&#xFF08;<code>Build -&gt; Make Project</code>) &#x5C06;&#x4EA7;&#x751F;&#x76F8;&#x540C;&#x7684;&#x6548;&#x679C;&#x3002;</p>
<hr>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x53EA;&#x8981; forking &#x88AB;&#x5F00;&#x542F;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x53D7;&#x652F;&#x6301;&#x7684;&#x6784;&#x5EFA;&#x5DE5;&#x5177;&#xFF08;&#x5982; Maven &#x6216; Gradle&#xFF09;&#x6765;&#x542F;&#x7528;&#x5E94;&#x7528;&#xFF0C;&#x56E0;&#x4E3A; DevTools &#x9700;&#x8981;&#x9694;&#x79BB;&#x5E94;&#x7528;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x624D;&#x80FD;&#x6B63;&#x5E38;&#x8FD0;&#x884C;&#x3002;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x5F53;&#x5728; classpath &#x4E0B;&#x68C0;&#x6D4B;&#x5230; DevTools &#x65F6;&#xFF0C;Gradle &#x548C; Maven &#x4F1A;&#x8FD9;&#x4E48;&#x505A;&#x3002;</p>
</blockquote>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x81EA;&#x52A8;&#x91CD;&#x542F;&#x529F;&#x80FD;&#x4E0E; LiveReload&#xFF08;&#x5B9E;&#x65F6;&#x91CD;&#x8F7D;&#xFF09;&#x4E00;&#x8D77;&#x4F7F;&#x7528;&#x6548;&#x679C;&#x66F4;&#x68D2;&#x3002;<a href="#using-boot-devtools-livereload">&#x9605;&#x8BFB; LiveReload &#x7AE0;&#x8282;</a>&#x4EE5;&#x83B7;&#x53D6;&#x66F4;&#x591A;&#x4FE1;&#x606F;&#x3002;&#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528; JRebel&#xFF0C;&#x81EA;&#x52A8;&#x91CD;&#x542F;&#x5C06;&#x4F1A;&#x88AB;&#x7981;&#x7528;&#xFF0C;&#x4EE5;&#x652F;&#x6301;&#x52A8;&#x6001;&#x7C7B;&#x91CD;&#x8F7D;&#xFF0C;&#x4F46;&#x5176;&#x4ED6; devtools &#x529F;&#x80FD;&#xFF08;&#x5982; LiveReload &#x548C; property &#x8986;&#x76D6;&#xFF09;&#x4ECD;&#x7136;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x3002;</p>
</blockquote>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>DevTools &#x4F9D;&#x8D56;&#x4E8E;&#x5E94;&#x7528;&#x4E0A;&#x4E0B;&#x6587;&#x7684;&#x5173;&#x95ED;&#x94A9;&#x5B50;&#xFF0C;&#x4EE5;&#x5728;&#x91CD;&#x542F;&#x671F;&#x95F4;&#x5173;&#x95ED;&#x81EA;&#x5DF1;&#x3002;&#x5982;&#x679C;&#x7981;&#x7528;&#x4E86;&#x5173;&#x95ED;&#x94A9;&#x5B50;&#xFF08;<code>SpringApplication.setRegisterShutdownHook(false)</code>&#xFF09;&#xFF0C;&#x5B83;&#x5C06;&#x4E0D;&#x80FD;&#x6B63;&#x5E38;&#x5DE5;&#x4F5C;&#x3002;</p>
</blockquote>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x5F53; classpath &#x4E0B;&#x7684;&#x5185;&#x5BB9;&#x53D1;&#x751F;&#x66F4;&#x6539;&#xFF0C;&#x51B3;&#x5B9A;&#x662F;&#x5426;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x65F6;&#xFF0C;DevTools &#x4F1A;&#x81EA;&#x52A8;&#x5FFD;&#x7565;&#x540D;&#x4E3A; <code>spring-boot</code>&#x3001;<code>spring-boot-devtools</code>&#x3001;<code>spring-boot-autoconfigure</code>&#x3001;<code>spring-boot-actuator</code> &#x548C; <code>spring-boot-starter</code> &#x7684;&#x9879;&#x76EE;&#x3002;</p>
</blockquote>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>DevTools &#x9700;&#x8981;&#x81EA;&#x5B9A;&#x4E49; <code>ApplicationContext</code> &#x4F7F;&#x7528;&#x5230;&#x7684; <code>ResourceLoader</code>&#x3002;&#x5982;&#x679C;&#x60A8;&#x7684;&#x5E94;&#x7528;&#x5DF2;&#x7ECF;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#xFF0C;&#x5B83;&#x5C06;&#x88AB;&#x5305;&#x88C5;&#x8D77;&#x6765;&#xFF0C;&#x56E0;&#x4E3A;&#x4E0D;&#x652F;&#x6301;&#x5728; <code>ApplicationContext</code> &#x4E0A;&#x76F4;&#x63A5;&#x8986;&#x76D6; <code>getResource</code> &#x65B9;&#x6CD5;&#x3002;</p>
</blockquote>
<hr>
<p><strong>&#x91CD;&#x542F;&#xFF08;Restart&#xFF09;&#x4E0E;&#x91CD;&#x8F7D;&#xFF08;Reload&#xFF09;</strong></p>
<p>Spring Boot &#x901A;&#x8FC7;&#x4F7F;&#x7528;&#x4E24;&#x4E2A;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x6765;&#x63D0;&#x4F9B;&#x4E86;&#x91CD;&#x542F;&#x6280;&#x672F;&#x3002;&#x4E0D;&#x6539;&#x53D8;&#x7684;&#x7C7B;&#xFF08;&#x4F8B;&#x5982;&#xFF0C;&#x7B2C;&#x4E09;&#x65B9; jar&#xFF09;&#x88AB;&#x52A0;&#x8F7D;&#x5230; <strong>base</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x4E2D;&#x3002;&#x7ECF;&#x5E38;&#x5904;&#x4E8E;&#x5F00;&#x53D1;&#x72B6;&#x6001;&#x7684;&#x7C7B;&#x88AB;&#x52A0;&#x8F7D;&#x5230; <strong>restart</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x4E2D;&#x3002;&#x5F53;&#x5E94;&#x7528;&#x91CD;&#x542F;&#x65F6;&#xFF0C;<strong>restart</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x5C06;&#x88AB;&#x4E22;&#x5F03;&#xFF0C;&#x5E76;&#x91CD;&#x65B0;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684;&#x3002;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x610F;&#x5473;&#x7740;&#x5E94;&#x7528;&#x91CD;&#x542F;&#x6BD4;<strong>&#x51B7;&#x542F;&#x52A8;</strong>&#x8981;&#x5FEB;&#x5F97;&#x591A;&#xFF0C;&#x56E0;&#x4E3A;&#x7701;&#x53BB; <strong>base</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x7684;&#x5904;&#x7406;&#x6B65;&#x9AA4;&#xFF0C;&#x5E76;&#x4E14;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x89C9;&#x5F97;&#x91CD;&#x542F;&#x8FD8;&#x4E0D;&#x591F;&#x5FEB;&#xFF0C;&#x6216;&#x8005;&#x9047;&#x5230;&#x7C7B;&#x52A0;&#x8F7D;&#x95EE;&#x9898;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x8003;&#x8651;&#x5982; ZeroTurnaround &#x7684; <a href="https://zeroturnaround.com/software/jrebel/" target="_blank">JRebel</a> &#x7B49;&#x5DE5;&#x5177;&#x3002;&#x4ED6;&#x4EEC;&#x662F;&#x901A;&#x8FC7;&#x5728;&#x52A0;&#x8F7D;&#x7C7B;&#x65F6;&#x91CD;&#x5199;&#x7C7B;&#x6765;&#x52A0;&#x5FEB;&#x91CD;&#x65B0;&#x52A0;&#x8F7D;&#x3002;</p>
<hr>
<p><a id="using-boot-devtools-restart-logging-condition-delta"></a></p>
<h4 id="2021&#x3001;&#x6761;&#x4EF6;&#x8BC4;&#x4F30;&#x53D8;&#x66F4;&#x65E5;&#x5FD7;">20.2.1&#x3001;&#x6761;&#x4EF6;&#x8BC4;&#x4F30;&#x53D8;&#x66F4;&#x65E5;&#x5FD7;</h4>
<p>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6BCF;&#x6B21;&#x5E94;&#x7528;&#x91CD;&#x542F;&#x65F6;&#xFF0C;&#x90FD;&#x4F1A;&#x8BB0;&#x5F55;&#x663E;&#x793A;&#x6761;&#x4EF6;&#x8BC4;&#x4F30;&#x589E;&#x91CF;&#x7684;&#x62A5;&#x544A;&#x3002;&#x8BE5;&#x62A5;&#x544A;&#x5C55;&#x793A;&#x4E86;&#x5728;&#x60A8;&#x8FDB;&#x884C;&#x66F4;&#x6539;&#xFF08;&#x5982;&#x6DFB;&#x52A0;&#x6216;&#x5220;&#x9664; bean &#x4EE5;&#x53CA;&#x8BBE;&#x7F6E;&#x914D;&#x7F6E;&#x5C5E;&#x6027;&#xFF09;&#x65F6;&#x5BF9;&#x5E94;&#x7528;&#x81EA;&#x52A8;&#x914D;&#x7F6E;&#x6240;&#x4F5C;&#x51FA;&#x7684;&#x66F4;&#x6539;&#x3002;</p>
<p>&#x8981;&#x7981;&#x7528;&#x62A5;&#x544A;&#x7684;&#x65E5;&#x5FD7;&#x8BB0;&#x5F55;&#xFF0C;&#x8BF7;&#x8BBE;&#x7F6E;&#x4EE5;&#x4E0B;&#x5C5E;&#x6027;&#xFF1A;</p>
<pre class="language-"><code class="lang-properties"><span class="token attr-name">spring.devtools.restart.log-condition-evaluation-delta</span><span class="token punctuation">=</span><span class="token attr-value">false</span>
</code></pre>
<p><a id="using-boot-devtools-restart-exclude"></a></p>
<h4 id="2022&#x3001;&#x6392;&#x9664;&#x8D44;&#x6E90;">20.2.2&#x3001;&#x6392;&#x9664;&#x8D44;&#x6E90;</h4>
<p>&#x67D0;&#x4E9B;&#x8D44;&#x6E90;&#x5728;&#x66F4;&#x6539;&#x65F6;&#x4E0D;&#x4E00;&#x5B9A;&#x9700;&#x8981;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x3002;&#x4F8B;&#x5982;&#xFF0C;Thymeleaf &#x6A21;&#x677F;&#x53EF;&#x4EE5;&#x5B9E;&#x65F6;&#x7F16;&#x8F91;&#x3002;&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x66F4;&#x6539; <code>/META-INF/maven</code>&#x3001;<code>/META-INF/resources</code>&#x3001;<code>/resources</code>&#x3001;<code>/static</code>&#x3001;<code>/public</code> &#x6216;&#x8005; <code>/templates</code> &#x4E0D;&#x4F1A;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#xFF0C;&#x4F46;&#x4F1A;&#x89E6;&#x53D1; <a href="#using-boot-devtools-livereload">LiveReload</a>&#x3002;&#x5982;&#x679C;&#x60A8;&#x60F3;&#x81EA;&#x5B9A;&#x4E49;&#x6392;&#x9664;&#x9879;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>spring.devtools.restart.exclude</code> &#x5C5E;&#x6027;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x4EC5;&#x6392;&#x9664; <code>/static</code> &#x548C; <code>/public</code>&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x8BBE;&#x7F6E;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#xFF1A;</p>
<pre class="language-"><code class="lang-properties"><span class="token attr-name">spring.devtools.restart.exclude</span><span class="token punctuation">=</span><span class="token attr-value">static/**,public/**</span>
</code></pre>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x5982;&#x679C;&#x8981;&#x4FDD;&#x7559;&#x8FD9;&#x4E9B;&#x9ED8;&#x8BA4;&#x503C;&#x5E76;<strong>&#x6DFB;&#x52A0;</strong>&#x5176;&#x4ED6;&#x6392;&#x9664;&#x9879; &#xFF0C;&#x8BF7;&#x6539;&#x7528; <code>spring.devtools.restart.additional-exclude</code> &#x5C5E;&#x6027;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-restart-additional-paths"></a></p>
<h4 id="2023&#x3001;&#x76D1;&#x89C6;&#x9644;&#x52A0;&#x8DEF;&#x5F84;">20.2.3&#x3001;&#x76D1;&#x89C6;&#x9644;&#x52A0;&#x8DEF;&#x5F84;</h4>
<p>&#x5982;&#x679C;&#x60A8;&#x60F3;&#x5728;&#x5BF9;&#x4E0D;&#x5728; classpath &#x4E0B;&#x7684;&#x6587;&#x4EF6;&#x8FDB;&#x884C;&#x4FEE;&#x6539;&#x65F6;&#x91CD;&#x542F;&#x6216;&#x91CD;&#x8F7D;&#x5E94;&#x7528;&#xFF0C;&#x8BF7;&#x4F7F;&#x7528; <code>spring.devtools.restart.additional-paths</code> &#x5C5E;&#x6027;&#x6765;&#x914D;&#x7F6E;&#x76D1;&#x89C6;&#x5176;&#x4ED6;&#x8DEF;&#x5F84;&#x7684;&#x66F4;&#x6539;&#x60C5;&#x51B5;&#x3002;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;<a href="#using-boot-devtools-restart-exclude">&#x4E0A;&#x8FF0;</a>&#x7684; <code>spring.devtools.restart.exclude</code> &#x5C5E;&#x6027;&#x6765;&#x63A7;&#x5236;&#x9644;&#x52A0;&#x8DEF;&#x5F84;&#x4E0B;&#x7684;&#x6587;&#x4EF6;&#x88AB;&#x4FEE;&#x6539;&#x65F6;&#x662F;&#x5426;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x6216;&#x53EA;&#x662F; <a href="#using-boot-devtools-livereload">LiveReload</a>&#x3002;</p>
<p><a id="using-boot-devtools-restart-disable"></a></p>
<h4 id="2024&#x3001;&#x7981;&#x7528;&#x91CD;&#x542F;">20.2.4&#x3001;&#x7981;&#x7528;&#x91CD;&#x542F;</h4>
<p>&#x60A8;&#x5982;&#x679C;&#x4E0D;&#x60F3;&#x4F7F;&#x7528;&#x91CD;&#x542F;&#x529F;&#x80FD;&#xFF0C;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>spring.devtools.restart.enabled</code> &#x5C5E;&#x6027;&#x6765;&#x7981;&#x7528;&#x5B83;&#x3002;&#x4E00;&#x822C;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x5728; <code>application.properties</code> &#x4E2D;&#x8BBE;&#x7F6E;&#x6B64;&#x5C5E;&#x6027;&#xFF08;&#x91CD;&#x542F;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x4ECD;&#x5C06;&#x88AB;&#x521D;&#x59CB;&#x5316;&#xFF0C;&#x4F46;&#x4E0D;&#x4F1A;&#x76D1;&#x89C6;&#x6587;&#x4EF6;&#x66F4;&#x6539;&#xFF09;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x9700;&#x8981;<strong>&#x5B8C;&#x5168;</strong>&#x7981;&#x7528;&#x91CD;&#x542F;&#x652F;&#x6301;&#xFF08;&#x4F8B;&#x5982;&#xFF0C;&#x53EF;&#x80FD;&#x5B83;&#x4E0D;&#x9002;&#x7528;&#x4E8E;&#x67D0;&#x4E9B;&#x7C7B;&#x5E93;&#xFF09;&#xFF0C;&#x60A8;&#x9700;&#x8981;&#x5728;&#x8C03;&#x7528; <code>SpringApplication.run(&#x200B;...)</code> &#x4E4B;&#x524D;&#x5C06; System &#x5C5E;&#x6027; <code>spring.devtools.restart.enabled System</code> &#x8BBE;&#x7F6E;&#x4E3A; <code>false</code>&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-java"><span class="token keyword">public</span> <span class="token keyword">static</span> <span class="token keyword">void</span> <span class="token function">main</span><span class="token punctuation">(</span><span class="token class-name">String</span><span class="token punctuation">[</span><span class="token punctuation">]</span> args<span class="token punctuation">)</span> <span class="token punctuation">{</span>
    <span class="token class-name">System</span><span class="token punctuation">.</span><span class="token function">setProperty</span><span class="token punctuation">(</span><span class="token string">&quot;spring.devtools.restart.enabled&quot;</span><span class="token punctuation">,</span> <span class="token string">&quot;false&quot;</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    <span class="token class-name">SpringApplication</span><span class="token punctuation">.</span><span class="token function">run</span><span class="token punctuation">(</span><span class="token class-name">MyApp</span><span class="token punctuation">.</span><span class="token keyword">class</span><span class="token punctuation">,</span> args<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
</code></pre>
<p><a id="using-boot-devtools-restart-triggerfile"></a></p>
<h4 id="2025&#x3001;&#x4F7F;&#x7528;&#x89E6;&#x53D1;&#x6587;&#x4EF6;">20.2.5&#x3001;&#x4F7F;&#x7528;&#x89E6;&#x53D1;&#x6587;&#x4EF6;</h4>
<p>&#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528; IDE &#x8FDB;&#x884C;&#x5F00;&#x53D1;&#xFF0C;&#x5E76;&#x4E14;&#x65F6;&#x65F6;&#x523B;&#x523B;&#x5728;&#x7F16;&#x8BD1;&#x66F4;&#x6539;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x6216;&#x8BB8;&#x60A8;&#x53EA;&#x662F;&#x5E0C;&#x671B;&#x5728;&#x7279;&#x5B9A;&#x7684;&#x65F6;&#x95F4;&#x5185;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x3002;&#x4E3A;&#x6B64;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;<strong>&#x89E6;&#x53D1;&#x6587;&#x4EF6;</strong>&#xFF0C;&#x8FD9;&#x662F;&#x4E00;&#x4E2A;&#x7279;&#x6B8A;&#x6587;&#x4EF6;&#xFF0C;&#x60A8;&#x60F3;&#x8981;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#x68C0;&#x67E5;&#x65F6;&#xFF0C;&#x5FC5;&#x987B;&#x4FEE;&#x6539;&#x5B83;&#x3002;&#x66F4;&#x6539;&#x6587;&#x4EF6;&#x53EA;&#x4F1A;&#x89E6;&#x53D1;&#x68C0;&#x67E5;&#xFF0C;&#x53EA;&#x6709;&#x5728; Devtools &#x68C0;&#x67E5;&#x5230;&#x5B83;&#x9700;&#x8981;&#x505A;&#x67D0;&#x4E9B;&#x64CD;&#x4F5C;&#x65F6;&#x624D;&#x4F1A;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#xFF0C;&#x53EF;&#x4EE5;&#x624B;&#x52A8;&#x66F4;&#x65B0;&#x89E6;&#x53D1;&#x6587;&#x4EF6;&#xFF0C;&#x4E5F;&#x53EF;&#x4EE5;&#x901A;&#x8FC7; IDE &#x63D2;&#x4EF6;&#x66F4;&#x65B0;&#x3002;</p>
<p>&#x8981;&#x4F7F;&#x7528;&#x89E6;&#x53D1;&#x6587;&#x4EF6;&#xFF0C;&#x8BF7;&#x8BBE;&#x7F6E; <code>spring.devtools.restart.trigger-file</code> &#x5C5E;&#x6027;&#x6307;&#x5411;&#x89E6;&#x53D1;&#x6587;&#x4EF6;&#x7684;&#x8DEF;&#x5F84;&#x3002;</p>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x60A8;&#x4E5F;&#x8BB8;&#x60F3;&#x5C06; <code>spring.devtools.restart.trigger-file</code> &#x8BBE;&#x7F6E;&#x6210;&#x4E00;&#x4E2A;<a href="#using-boot-devtools-globalsettings">&#x5168;&#x5C40;&#x914D;&#x7F6E;</a>&#xFF0C;&#x4EE5;&#x4F7F;&#x5F97;&#x6240;&#x6709;&#x7684;&#x9879;&#x76EE;&#x90FD;&#x80FD;&#x5E94;&#x7528;&#x6B64;&#x65B9;&#x5F0F;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-customizing-classload"></a></p>
<h4 id="2026&#x3001;&#x81EA;&#x5B9A;&#x4E49;&#x91CD;&#x542F;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;">20.2.6&#x3001;&#x81EA;&#x5B9A;&#x4E49;&#x91CD;&#x542F;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;</h4>
<p>&#x6B63;&#x5982;&#x4E4B;&#x524D;&#x7684;<a href="#using-spring-boot-restart-vs-reload">&#x91CD;&#x542F;&#x548C;&#x91CD;&#x8F7D;</a>&#x90E8;&#x5206;&#x6240;&#x8FF0;&#xFF0C;&#x91CD;&#x542F;&#x529F;&#x80FD;&#x662F;&#x901A;&#x8FC7;&#x4F7F;&#x7528;&#x4E24;&#x4E2A;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x6765;&#x5B9E;&#x73B0;&#x7684;&#x3002;&#x5BF9;&#x4E8E;&#x5927;&#x591A;&#x6570;&#x5E94;&#x7528;&#x800C;&#x8A00;&#xFF0C;&#x8FD9;&#x79CD;&#x65B9;&#x5F0F;&#x5F88;&#x597D;&#xFF0C;&#x7136;&#x800C;&#xFF0C;&#x6709;&#x65F6;&#x53EF;&#x80FD;&#x4F1A;&#x5BFC;&#x81F4;&#x7C7B;&#x52A0;&#x8F7D;&#x51FA;&#x73B0;&#x95EE;&#x9898;&#x3002;</p>
<p>&#x9ED8;&#x8BA4;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;IDE &#x4E2D;&#x4EFB;&#x4F55;&#x6253;&#x5F00;&#x7684;&#x9879;&#x76EE;&#x5C06;&#x4F7F;&#x7528; <strong>restart</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x52A0;&#x8F7D;&#xFF0C;&#x4EFB;&#x4F55;&#x5E38;&#x89C4;&#x7684; <code>.jar</code> &#x6587;&#x4EF6;&#x5C06;&#x4F7F;&#x7528; <strong>base</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x52A0;&#x8F7D;&#x3002;&#x60A8;&#x5982;&#x679C;&#x5F00;&#x53D1;&#x7684;&#x662F;&#x591A;&#x6A21;&#x5757;&#x9879;&#x76EE;&#xFF0C;&#x800C;&#x4E0D;&#x662F;&#x6BCF;&#x4E00;&#x4E2A;&#x6A21;&#x5757;&#x90FD;&#x5BFC;&#x5165;&#x5230; IDE &#x4E2D;&#xFF0C;&#x5219;&#x53EF;&#x80FD;&#x9700;&#x8981;&#x81EA;&#x5B9A;&#x4E49;&#x3002;&#x4E3A;&#x6B64;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x521B;&#x5EFA;&#x4E00;&#x4E2A; <code>META-INF/spring-devtools.properties</code> &#x6587;&#x4EF6;&#x3002;</p>
<p><code>spring-devtools.properties</code> &#x6587;&#x4EF6;&#x53EF;&#x4EE5;&#x5305;&#x542B;&#x4EE5; <code>restart.exclude.</code> &#x548C; <code>restart.include.</code> &#x4E3A;&#x524D;&#x7F00;&#x7684;&#x5C5E;&#x6027;&#x3002;<code>include</code> &#x5143;&#x7D20;&#x662F;&#x52A0;&#x8F7D;&#x5230; <strong>restart</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x7684;&#x9879;&#xFF0C;<code>exclude</code> &#x5143;&#x7D20;&#x662F;&#x52A0;&#x8F7D;&#x5230; <strong>base</strong> &#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x7684;&#x9879;&#x3002;&#x5C5E;&#x6027;&#x503C;&#x662F;&#x4E00;&#x4E2A;&#x5E94;&#x7528;&#x5230; classpath &#x7684;&#x6B63;&#x5219;&#x8868;&#x8FBE;&#x5F0F;&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre class="language-"><code class="lang-properties"><span class="token attr-name">restart.exclude.companycommonlibs</span><span class="token punctuation">=</span><span class="token attr-value">/mycorp-common-[\\w-]+\.jar</span>
<span class="token attr-name">restart.include.projectcommon</span><span class="token punctuation">=</span><span class="token attr-value">/mycorp-myproj-[\\w-]+\.jar</span>
</code></pre>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x6240;&#x6709;&#x5C5E;&#x6027;&#x952E;&#x540D;&#x5FC5;&#x987B;&#x662F;&#x552F;&#x4E00;&#x7684;&#x3002;&#x53EA;&#x8981;&#x6709;&#x4E00;&#x4E2A;&#x5C5E;&#x6027;&#x4EE5; <code>restart.include.</code> &#x6216; <code>restart.exclude.</code> &#x5F00;&#x5934;&#xFF0C;&#x5B83;&#x5C06;&#x4F1A;&#x88AB;&#x8003;&#x8651;&#x3002;</p>
</blockquote>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>classpath &#x4E0B;&#x7684;&#x6240;&#x6709; <code>META-INF/spring-devtools.properties</code> &#x6587;&#x4EF6;&#x5C06;&#x88AB;&#x52A0;&#x8F7D;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x5C06;&#x5B83;&#x4EEC;&#x6253;&#x5305;&#x8FDB;&#x5DE5;&#x7A0B;&#x6216;&#x8005;&#x7C7B;&#x5E93;&#x4E2D;&#x4E3A;&#x9879;&#x76EE;&#x6240;&#x7528;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-known-restart-limitations"></a></p>
<h4 id="2027&#x3001;&#x5DF2;&#x77E5;&#x9650;&#x5236;">20.2.7&#x3001;&#x5DF2;&#x77E5;&#x9650;&#x5236;</h4>
<p>&#x91CD;&#x65B0;&#x542F;&#x52A8;&#x529F;&#x80FD;&#x5BF9;&#x4F7F;&#x7528;&#x6807;&#x51C6; <code>ObjectInputStream</code> &#x53CD;&#x5E8F;&#x5217;&#x5316;&#x7684;&#x5BF9;&#x8C61;&#x65E0;&#x6548;&#x3002;&#x60A8;&#x5982;&#x679C;&#x9700;&#x8981;&#x53CD;&#x5E8F;&#x5217;&#x5316;&#x6570;&#x636E;&#xFF0C;&#x53EF;&#x80FD;&#x9700;&#x8981;&#x4F7F;&#x7528; Spring &#x7684; <code>ConfigurableObjectInputStream</code> &#x914D;&#x5408; <code>Thread.currentThread().getContextClassLoader()</code>&#x3002;</p>
<p>&#x9057;&#x61BE;&#x7684;&#x662F;&#xFF0C;&#x4E00;&#x4E9B;&#x7B2C;&#x4E09;&#x65B9;&#x7C7B;&#x5E93;&#x5728;&#x6CA1;&#x6709;&#x8003;&#x8651;&#x4E0A;&#x4E0B;&#x6587;&#x7C7B;&#x52A0;&#x8F7D;&#x5668;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#x4F7F;&#x7528;&#x4E86;&#x53CD;&#x5E8F;&#x5217;&#x5316;&#x3002;&#x60A8;&#x5982;&#x679C;&#x9047;&#x5230;&#x6B64;&#x95EE;&#x9898;&#xFF0C;&#x9700;&#x8981;&#x5411;&#x539F;&#x4F5C;&#x8005;&#x63D0;&#x4EA4;&#x4FEE;&#x590D;&#x8BF7;&#x6C42;&#x3002;</p>
<p><a id="using-boot-devtools-livereload"></a></p>
<h3 id="203&#x3001;livereload">20.3&#x3001;LiveReload</h3>
<p><code>spring-boot-devtools</code> &#x6A21;&#x5757;&#x5305;&#x62EC;&#x4E86;&#x4E00;&#x4E2A;&#x5185;&#x5D4C; LiveReload &#x670D;&#x52A1;&#x5668;&#xFF0C;&#x5B83;&#x53EF;&#x5728;&#x8D44;&#x6E90;&#x53D1;&#x751F;&#x66F4;&#x6539;&#x65F6;&#x89E6;&#x53D1;&#x6D4F;&#x89C8;&#x5668;&#x5237;&#x65B0;&#x3002;&#x60A8;&#x53EF;&#x4EE5;&#x4ECE; <a href="http://livereload.com/extensions/" target="_blank">livereload.com</a> &#x4E0A;&#x514D;&#x8D39;&#x83B7;&#x53D6; Chrome&#x3001;Firefox &#x548C; Safari &#x5E73;&#x53F0;&#x4E0B;&#x5BF9;&#x5E94;&#x7684; LiveReload &#x6D4F;&#x89C8;&#x5668;&#x6269;&#x5C55;&#x7A0B;&#x5E8F;&#x3002;</p>
<p>&#x5982;&#x679C;&#x60A8;&#x4E0D;&#x60F3;&#x5728;&#x5E94;&#x7528;&#x8FD0;&#x884C;&#x65F6;&#x542F;&#x52A8; LiveReload &#x670D;&#x52A1;&#x5668;&#xFF0C;&#x53EF;&#x4EE5;&#x5C06; <code>spring.devtools.livereload.enabled</code> &#x5C5E;&#x6027;&#x8BBE;&#x7F6E;&#x4E3A; <code>false</code>&#x3002;</p>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x60A8;&#x4E00;&#x6B21;&#x53EA;&#x80FD;&#x8FD0;&#x884C;&#x4E00;&#x4E2A; LiveReload &#x670D;&#x52A1;&#x5668;&#x3002;&#x5728;&#x542F;&#x52A8;&#x5E94;&#x7528;&#x4E4B;&#x524D;&#xFF0C;&#x8BF7;&#x786E;&#x4FDD;&#x6CA1;&#x6709;&#x5176;&#x4ED6; LiveReload &#x670D;&#x52A1;&#x5668;&#x6B63;&#x5728;&#x8FD0;&#x884C;&#x3002;&#x5982;&#x679C;&#x5728; IDE &#x4E2D;&#x542F;&#x52A8;&#x4E86;&#x591A;&#x4E2A;&#x5E94;&#x7528;&#xFF0C;&#x90A3;&#x4E48;&#x53EA;&#x6709;&#x7B2C;&#x4E00;&#x4E2A;&#x5E94;&#x7528;&#x7684; LiveReload &#x751F;&#x6548;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-globalsettings"></a></p>
<h3 id="204&#x3001;&#x5168;&#x5C40;&#x8BBE;&#x7F6E;">20.4&#x3001;&#x5168;&#x5C40;&#x8BBE;&#x7F6E;</h3>
<p>&#x60A8;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x5728; <code>$HOME</code> &#x76EE;&#x5F55;&#x4E2D;&#x6DFB;&#x52A0;&#x540D;&#x4E3A; <code>.spring-boot-devtools.properties</code> &#x7684;&#x6587;&#x4EF6;&#x6765;&#x914D;&#x7F6E;&#x5168;&#x5C40; devtools &#x8BBE;&#x7F6E;&#xFF08;&#x8BF7;&#x6CE8;&#x610F;&#xFF0C;&#x6587;&#x4EF6;&#x540D;&#x4EE5;&#x201C;.&#x201D;&#x5F00;&#x5934;&#xFF09;&#x3002;&#x5728;&#x6B64;&#x6587;&#x4EF6;&#x4E2D;&#x6DFB;&#x52A0;&#x7684;&#x4EFB;&#x4F55;&#x5C5E;&#x6027;&#x5C06;&#x5E94;&#x7528;&#x5230;&#x60A8;&#x7684;&#x8BA1;&#x7B97;&#x673A;&#x4E0A;<strong>&#x6240;&#x6709;</strong>&#x4F7F;&#x7528;&#x4E86; devtools &#x7684; Spring Boot &#x5E94;&#x7528;&#x3002;&#x4F8B;&#x5982;&#xFF0C;&#x59CB;&#x7EC8;&#x4F7F;&#x7528;<a href="#using-boot-devtools-restart-triggerfile">&#x89E6;&#x53D1;&#x6587;&#x4EF6;</a>&#x6765;&#x914D;&#x7F6E;&#x91CD;&#x542F;&#x529F;&#x80FD;&#xFF0C;&#x60A8;&#x53EF;&#x4EE5;&#x6DFB;&#x52A0;&#x4EE5;&#x4E0B;&#x5185;&#x5BB9;&#xFF1A;</p>
<p><strong>~/.spring-boot-devtools.properties.</strong></p>
<pre class="language-"><code>spring.devtools.reload.trigger-file=.reloadtrigger
</code></pre><p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x5728; <code>.spring-boot-devtools.properties</code> &#x4E2D;&#x6FC0;&#x6D3B;&#x7684; profile &#x5C06;&#x4E0D;&#x4F1A;&#x5F71;&#x54CD;&#x6307;&#x5B9A; profile &#x7684;&#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x7684;&#x52A0;&#x8F7D;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-remote"></a></p>
<h3 id="205&#x3001;&#x8FDC;&#x7A0B;&#x5E94;&#x7528;">20.5&#x3001;&#x8FDC;&#x7A0B;&#x5E94;&#x7528;</h3>
<p>Spring Boot &#x5F00;&#x53D1;&#x8005;&#x5DE5;&#x5177;&#x4E0D;&#x5C40;&#x9650;&#x4E8E;&#x672C;&#x5730;&#x5F00;&#x53D1;&#x3002;&#x5728;&#x8FDC;&#x7A0B;&#x8FD0;&#x884C;&#x5E94;&#x7528;&#x65F6;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528;&#x8BB8;&#x591A;&#x529F;&#x80FD;&#x3002;&#x8FDC;&#x7A0B;&#x652F;&#x6301;&#x529F;&#x80FD;&#x662F;&#x53EF;&#x9009;&#x7684;&#xFF0C;&#x5982;&#x679C;&#x8981;&#x542F;&#x7528;&#xFF0C;&#x60A8;&#x9700;&#x8981;&#x786E;&#x4FDD;&#x5728;&#x91CD;&#x65B0;&#x6253;&#x5305;&#x5F52;&#x6863;&#x6587;&#x4EF6;&#x65F6;&#x5305;&#x542B; <code>devtools</code>&#xFF1A;</p>
<pre class="language-"><code class="lang-xml"><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>build</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugins</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>plugin</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>groupId</span><span class="token punctuation">&gt;</span></span>org.springframework.boot<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>groupId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>artifactId</span><span class="token punctuation">&gt;</span></span>spring-boot-maven-plugin<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>artifactId</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>configuration</span><span class="token punctuation">&gt;</span></span>
                <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>excludeDevtools</span><span class="token punctuation">&gt;</span></span>false<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>excludeDevtools</span><span class="token punctuation">&gt;</span></span>
            <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>configuration</span><span class="token punctuation">&gt;</span></span>
        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>plugin</span><span class="token punctuation">&gt;</span></span>
    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>plugins</span><span class="token punctuation">&gt;</span></span>
<span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span>build</span><span class="token punctuation">&gt;</span></span>
</code></pre>
<p>&#x4E4B;&#x540E;&#x60A8;&#x9700;&#x8981;&#x8BBE;&#x7F6E;&#x4E00;&#x4E2A; <code>spring.devtools.remote.secret</code> &#x5C5E;&#x6027;&#xFF0C;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre class="language-"><code>spring.devtools.remote.secret=mysecret
</code></pre><p><strong>&#x8B66;&#x544A;</strong></p>
<blockquote>
<p>&#x5728;&#x8FDC;&#x7A0B;&#x5E94;&#x7528;&#x4E0A;&#x542F;&#x7528; <code>spring-boot-devtools</code> &#x662F;&#x5B58;&#x5728;&#x5B89;&#x5168;&#x9690;&#x60A3;&#x7684;&#x3002;&#x60A8;&#x4E0D;&#x5E94;&#x8BE5;&#x5728;&#x751F;&#x4EA7;&#x90E8;&#x7F72;&#x65F6;&#x542F;&#x7528;&#x5B83;&#x3002;</p>
</blockquote>
<p>&#x8FDC;&#x7A0B; devtools &#x652F;&#x6301;&#x5206;&#x4E3A;&#x4E24;&#x90E8;&#x5206;&#xFF1A;&#x63A5;&#x53D7;&#x8BF7;&#x6C42;&#x8FDE;&#x63A5;&#x7684;&#x670D;&#x52A1;&#x5668;&#x7AEF;&#x7AEF;&#x70B9;&#x548C;&#x5728; IDE &#x4E2D;&#x8FD0;&#x884C;&#x7684;&#x5BA2;&#x6237;&#x7AEF;&#x5E94;&#x7528;&#x3002;&#x5F53;&#x8BBE;&#x7F6E;&#x4E86; <code>spring.devtools.remote.secret</code> &#x5C5E;&#x6027;&#x65F6;&#xFF0C;&#x670D;&#x52A1;&#x5668;&#x7EC4;&#x4EF6;&#x5C06;&#x81EA;&#x52A8;&#x542F;&#x7528;&#x3002;&#x5BA2;&#x6237;&#x7AEF;&#x7EC4;&#x4EF6;&#x5FC5;&#x987B;&#x624B;&#x542F;&#x7528;&#x3002;</p>
<p><a id="_running_the_remote_client_application"></a></p>
<h4 id="2051&#x3001;&#x8FD0;&#x884C;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x5E94;&#x7528;">20.5.1&#x3001;&#x8FD0;&#x884C;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x5E94;&#x7528;</h4>
<p>&#x5047;&#x8BBE;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x5E94;&#x7528;&#x8FD0;&#x884C;&#x5728; IDE &#x4E2D;&#x3002;&#x60A8;&#x9700;&#x8981;&#x5728;&#x4E0E;&#x8981;&#x8FDE;&#x63A5;&#x7684;&#x8FDC;&#x7A0B;&#x9879;&#x76EE;&#x76F8;&#x540C;&#x7684; classpath &#x4E0B;&#x8FD0;&#x884C; <code>org.springframework.boot.devtools.RemoteSpringApplication</code>&#x3002;&#x628A;&#x8981;&#x8FDE;&#x63A5;&#x7684;&#x8FDC;&#x7A0B; URL &#x4F5C;&#x4E3A;&#x5FC5;&#x987B;&#x53C2;&#x6570;&#x4F20;&#x5165;&#x3002;</p>
<p>&#x4F8B;&#x5982;&#xFF0C;&#x5982;&#x679C;&#x60A8;&#x4F7F;&#x7528;&#x7684;&#x662F; Eclipse &#x6216; STS&#xFF0C;&#x5E76;&#x4E14;&#x6709;&#x4E00;&#x4E2A;&#x540D;&#x4E3A; <code>my-app</code> &#x7684;&#x9879;&#x76EE;&#x5DF2;&#x90E8;&#x7F72;&#x5230;&#x4E86; Cloud Foundry&#xFF0C;&#x5219;&#x53EF;&#x4EE5;&#x6267;&#x884C;&#x4EE5;&#x4E0B;&#x64CD;&#x4F5C;&#xFF1A;</p>
<ul>
<li>&#x5728; <code>Run</code> &#x83DC;&#x5355;&#x4E2D;&#x9009;&#x62E9;&#x9009;&#x62E9; <code>Run Configurations...</code>&#x200B;&#x3002;</li>
<li>&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x65B0;&#x7684; <code>Java Application</code> launch configuration&#x3002;</li>
<li>&#x6D4F;&#x89C8; <code>my-app</code> &#x9879;&#x76EE;&#x3002;</li>
<li>&#x4F7F;&#x7528; <code>org.springframework.boot.devtools.RemoteSpringApplication</code> &#x4F5C;&#x4E3A;&#x4E3B;&#x7C7B;&#x3002;</li>
<li>&#x5C06; <code>https://myapp.cfapps.io</code> &#x4F5C;&#x4E3A; <code>&#x7A0B;&#x5E8F;&#x53C2;&#x6570;</code> &#xFF08;&#x6216;&#x8005;&#x4EFB;&#x4F55;&#x8FDC;&#x7A0B; URL&#xFF09;&#x4F20;&#x5165;&#x3002;</li>
</ul>
<p>&#x8FD0;&#x884C;&#x7684;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x5C06;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre class="language-"><code>  .   ____          _                                              __ _ _
 /\\ / ___&apos;_ __ _ _(_)_ __  __ _          ___               _      \ \ \ \
( ( )\___ | &apos;_ | &apos;_| | &apos;_ \/ _` |        | _ \___ _ __  ___| |_ ___ \ \ \ \
 \\/  ___)| |_)| | | | | || (_| []::::::[]   / -_) &apos;  \/ _ \  _/ -_) ) ) ) )
  &apos;  |____| .__|_| |_|_| |_\__, |        |_|_\___|_|_|_\___/\__\___|/ / / /
 =========|_|==============|___/===================================/_/_/_/
 :: Spring Boot Remote :: 2.1.1.RELEASE

2015-06-10 18:25:06.632  INFO 14938 --- [           main] o.s.b.devtools.RemoteSpringApplication   : Starting RemoteSpringApplication on pwmbp with PID 14938 (/Users/pwebb/projects/spring-boot/code/spring-boot-devtools/target/classes started by pwebb in /Users/pwebb/projects/spring-boot/code/spring-boot-samples/spring-boot-sample-devtools)
2015-06-10 18:25:06.671  INFO 14938 --- [           main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2a17b7b6: startup date [Wed Jun 10 18:25:06 PDT 2015]; root of context hierarchy
2015-06-10 18:25:07.043  WARN 14938 --- [           main] o.s.b.d.r.c.RemoteClientConfiguration    : The connection to http://localhost:8080 is insecure. You should use a URL starting with &apos;https://&apos;.
2015-06-10 18:25:07.074  INFO 14938 --- [           main] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2015-06-10 18:25:07.130  INFO 14938 --- [           main] o.s.b.devtools.RemoteSpringApplication   : Started RemoteSpringApplication in 0.74 seconds (JVM running for 1.105)
</code></pre><p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x7531;&#x4E8E;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x4E0E;&#x5B9E;&#x9645;&#x5E94;&#x7528;&#x4F7F;&#x7528;&#x7684;&#x662F;&#x540C;&#x4E00;&#x4E2A; classpath&#xFF0C;&#x56E0;&#x6B64;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x8BFB;&#x53D6;&#x5E94;&#x7528;&#x7684; properties&#x3002;&#x8FD9;&#x4E5F;&#x662F; <code>spring.devtools.remote.secret</code> &#x5C5E;&#x6027;&#x4E3A;&#x4EC0;&#x4E48;&#x80FD;&#x88AB;&#x8BFB;&#x53D6;&#x548C;&#x4F20;&#x9012;&#x7ED9;&#x670D;&#x52A1;&#x5668;&#x8FDB;&#x884C;&#x8EAB;&#x4EFD;&#x9A8C;&#x8BC1;&#x7684;&#x539F;&#x56E0;&#x3002;</p>
</blockquote>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x5EFA;&#x8BAE;&#x4F7F;&#x7528; <code>https://</code> &#x4F5C;&#x4E3A;&#x8FDE;&#x63A5;&#x534F;&#x8BAE;&#xFF0C;&#x4EE5;&#x4FBF;&#x52A0;&#x5BC6;&#x4F20;&#x8F93;&#x5E76;&#x9632;&#x6B62;&#x5BC6;&#x7801;&#x88AB;&#x62E6;&#x622A;&#x3002;</p>
</blockquote>
<p><strong>&#x63D0;&#x793A;</strong></p>
<blockquote>
<p>&#x5982;&#x679C;&#x60A8;&#x9700;&#x8981;&#x901A;&#x8FC7;&#x4EE3;&#x7406;&#x6765;&#x8BBF;&#x95EE;&#x8FDC;&#x7A0B;&#x5E94;&#x7528;&#xFF0C;&#x8BF7;&#x914D;&#x7F6E; <code>spring.devtools.remote.proxy.host</code> &#x548C; <code>spring.devtools.remote.proxy.port</code> &#x5C5E;&#x6027;&#x3002;</p>
</blockquote>
<p><a id="using-boot-devtools-remote-update"></a></p>
<h4 id="2052&#x3001;&#x8FDC;&#x7A0B;&#x66F4;&#x65B0;">20.5.2&#x3001;&#x8FDC;&#x7A0B;&#x66F4;&#x65B0;</h4>
<p>&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x4F7F;&#x7528;&#x4E86;&#x4E0E;<a href="#using-boot-devtools-restart">&#x672C;&#x5730;&#x91CD;&#x542F;</a>&#x76F8;&#x540C;&#x7684;&#x65B9;&#x5F0F;&#x6765;&#x76D1;&#x63A7;&#x5E94;&#x7528; classpath &#x4E0B;&#x53D1;&#x751F;&#x7684;&#x66F4;&#x6539;&#x3002;&#x4EFB;&#x4F55;&#x66F4;&#x65B0;&#x7684;&#x8D44;&#x6E90;&#x5C06;&#x88AB;&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x5E94;&#x7528;&#x548C;&#x89E6;&#x53D1;&#x91CD;&#x542F;&#xFF08;<strong>&#x5982;&#x679C;&#x8981;&#x6C42;</strong>&#xFF09;&#x3002;&#x5982;&#x679C;&#x60A8;&#x6B63;&#x5728;&#x8FED;&#x4EE3;&#x4E00;&#x4E2A;&#x4F7F;&#x7528;&#x4E86;&#x672C;&#x5730;&#x6CA1;&#x6709;&#x7684;&#x4E91;&#x670D;&#x52A1;&#x7684;&#x529F;&#x80FD;&#xFF0C;&#x8FD9;&#x53EF;&#x80FD;&#x4F1A;&#x975E;&#x5E38;&#x6709;&#x7528;&#x3002;&#x901A;&#x5E38;&#x8FDC;&#x7A0B;&#x66F4;&#x65B0;&#x548C;&#x91CD;&#x542F;&#x6BD4;&#x5B8C;&#x5168;&#x91CD;&#x65B0;&#x6784;&#x5EFA;&#x548C;&#x90E8;&#x7F72;&#x7684;&#x5468;&#x671F;&#x8981;&#x5FEB;&#x5F97;&#x591A;&#x3002;</p>
<p><strong>&#x6CE8;&#x610F;</strong></p>
<blockquote>
<p>&#x6587;&#x4EF6;&#x53EA;&#x6709;&#x5728;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x8FD0;&#x884C;&#x65F6;&#x624D;&#x88AB;&#x76D1;&#x63A7;&#x3002;&#x5982;&#x679C;&#x60A8;&#x5728;&#x542F;&#x52A8;&#x8FDC;&#x7A0B;&#x5BA2;&#x6237;&#x7AEF;&#x4E4B;&#x524D;&#x66F4;&#x6539;&#x4E86;&#x6587;&#x4EF6;&#xFF0C;&#x6587;&#x4EF6;&#x5C06;&#x4E0D;&#x4F1A;&#x88AB;&#x63A8;&#x9001;&#x5230;&#x8FDC;&#x7A0B;&#x670D;&#x52A1;&#x5668;&#x3002;</p>
</blockquote>
<p><a id="using-boot-packaging-for-production"></a></p>
<h2 id="21&#x3001;&#x6253;&#x5305;&#x751F;&#x4EA7;&#x5E94;&#x7528;">21&#x3001;&#x6253;&#x5305;&#x751F;&#x4EA7;&#x5E94;&#x7528;</h2>
<p>&#x53EF;&#x6267;&#x884C; jar &#x53EF;&#x7528;&#x4E8E;&#x751F;&#x4EA7;&#x90E8;&#x7F72;&#xFF0C;&#x5B83;&#x4EEC;&#x662F;&#x72EC;&#x7ACB;&#xFF08;self-contained&#xFF0C;&#x72EC;&#x7ACB;&#x3001;&#x81EA;&#x5305;&#x542B;&#xFF09;&#x7684;&#xFF0C;&#x540C;&#x6837;&#x4E5F;&#x9002;&#x5408;&#x4E91;&#x90E8;&#x7F72;&#x3002;</p>
<p>&#x9488;&#x5BF9;&#x5176;&#x4ED6;<strong>&#x751F;&#x4EA7;&#x5C31;&#x7EEA;</strong>&#x529F;&#x80FD;&#xFF0C;&#x6BD4;&#x5982;&#x5065;&#x5EB7;&#x3001;&#x5BA1;&#x8BA1;&#x548C; REST &#x6216;&#x8005; JMX &#x7AEF;&#x70B9;&#x5EA6;&#x91CF;&#xFF0C;&#x53EF;&#x4EE5;&#x6DFB;&#x52A0; <code>spring-boot-actuator</code>&#x3002;&#x6709;&#x5173;&#x8FD9;&#x65B9;&#x9762;&#x7684;&#x8BE6;&#x7EC6;&#x4FE1;&#x606F;&#xFF0C;&#x8BF7;&#x53C2;&#x89C1; <a href="#production-ready">&#x7B2C;&#x4E94;&#x90E8;&#x5206;&#xFF1A;&#x201C;Spring Boot Actuator&#xFF1A;&#x751F;&#x4EA7;&#x5C31;&#x7EEA;&#x529F;&#x80FD;&#x201D;</a>&#x3002;</p>
<p><a id="using-boot-whats-next"></a></p>
<h2 id="22&#x3001;&#x4E0B;&#x4E00;&#x6B65;">22&#x3001;&#x4E0B;&#x4E00;&#x6B65;</h2>
<p>&#x60A8;&#x73B0;&#x5728;&#x5E94;&#x8BE5;&#x77E5;&#x9053;&#x5982;&#x4F55;&#x4F7F;&#x7528; Spring Boot &#x4EE5;&#x53CA;&#x5E94;&#x8BE5;&#x9075;&#x5FAA;&#x54EA;&#x4E9B;&#x6700;&#x4F73;&#x5B9E;&#x8DF5;&#x3002;&#x63A5;&#x4E0B;&#x6765;&#x60A8;&#x53EF;&#x4EE5;&#x6DF1;&#x5165;&#x5730;&#x4E86;&#x89E3; <a href="#boot-features">Spring Boot &#x529F;&#x80FD;</a>&#xFF0C;&#x6216;&#x8005;&#x60A8;&#x4E5F;&#x53EF;&#x4EE5;&#x8DF3;&#x8FC7;&#x4E0B;&#x4E00;&#x90E8;&#x5206;&#x76F4;&#x63A5;&#x9605;&#x8BFB;<a href="h#production-ready">&#x201C;&#x751F;&#x4EA7;&#x5C31;&#x7EEA;&#x529F;&#x80FD;&#x201D;</a>&#x65B9;&#x9762;&#x7684;&#x5185;&#x5BB9;&#x3002;</p>
<footer class="page-footer"><span class="copyright">powered by Gitbook</span><span class="footer-modification">File Modify: 
2020-01-07 23:30:15
</span></footer>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="getting-started.html#getting-started-whats-next" class="navigation navigation-prev " aria-label="Previous page: 12、下一步">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="using-spring-boot.html#using-boot-build-systems" class="navigation navigation-next " aria-label="Next page: 13、构建系统">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"三、使用 Spring Boot","level":"1.5","depth":1,"next":{"title":"13、构建系统","level":"1.5.1","depth":2,"anchor":"#using-boot-build-systems","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-build-systems","articles":[{"title":"13.1、依赖管理","level":"1.5.1.1","depth":3,"anchor":"#using-boot-dependency-management","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-dependency-management","articles":[]},{"title":"13.2、Maven","level":"1.5.1.2","depth":3,"anchor":"#using-boot-maven","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-maven","articles":[{"title":"13.2.1、继承 Starter Parent","level":"1.5.1.2.1","depth":4,"anchor":"#using-boot-maven-parent-pom","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-maven-parent-pom","articles":[{"title":"13.2.2、不使用父 POM","level":"1.5.1.2.1.1","depth":5,"anchor":"#using-boot-maven-without-a-parent","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-maven-without-a-parent","articles":[]},{"title":"13.2.3、使用 Spring Boot Maven 插件","level":"1.5.1.2.1.2","depth":5,"anchor":"#using-boot-maven-plugin","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-maven-plugin","articles":[]}]}]},{"title":"13.3、Gradle","level":"1.5.1.3","depth":3,"anchor":"#using-boot-gradle","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-gradle","articles":[]},{"title":"13.4、Ant","level":"1.5.1.4","depth":3,"anchor":"#using-boot-ant","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-ant","articles":[]},{"title":"13.5、Starter","level":"1.5.1.5","depth":3,"anchor":"#using-boot-starter","path":"pages/using-spring-boot.md","ref":"pages/using-spring-boot.md#using-boot-starter","articles":[]}]},"previous":{"title":"12、下一步","level":"1.4.5","depth":2,"anchor":"#getting-started-whats-next","path":"pages/getting-started.md","ref":"pages/getting-started.md#getting-started-whats-next","articles":[]},"dir":"ltr"},"config":{"plugins":["github","splitter","tbfed-pagefooter","-lunr","-search","search-plus","github-buttons","copy-code-button","prism","-highlight","-livereload","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{},"prism":{"css":["prismjs/themes/prism-twilight.css"]},"github":{"url":"https://gitee.com/lichongbing/springboot"},"splitter":{},"fontsettings":{"theme":"white","family":"sans","size":2},"github-buttons":{"repo":"lichongbing/springboot","types":["star","watch"],"size":"small"},"copy-code-button":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false},"search-plus":{},"image-captions":{"caption":"_CAPTION_"}},"theme":"default","author":"lichongbing.com","pdf":{"pageNumbers":true,"fontSize":16,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":36,"bottom":36}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Spring Boot 中文文档","language":"zh-hans","links":{"sharing":{"all":true,"facebook":true,"google":true,"twitter":true,"qzone":true,"weibo":true}},"gitbook":"*","description":"Spring Boot 中文文档","extension":null},"file":{"path":"pages/using-spring-boot.md","mtime":"2020-01-07T14:30:15.086Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2020-01-07T14:47:40.777Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-github/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/jquery.mark.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search-plus/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-github-buttons/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

